Subject: Re: Question about 'branch -d' safety

From: Nicolas Sebrecht <[email-masked]>
Date: Wed, 30 Dec 2009 22:08:37 +0100

The 30/12/09, Nanako Shiraishi wrote:
> Quoting Nicolas Sebrecht <[email-masked]>
> 
> > But even with it, we would hit some foreign workflow. Think: Bob
> > directly push to Alice and Alice does the same to Bob. I don't use this
> > kind of workflow myself but I consider them to be sensible enough to
> > have our attention.
> 
> Here is what I think about your scenario.
> 
> Bob directly pushes to Alice and Alice does the same to Bob, both to their refs/remotes/<other person>/ tracking branches

We can't say. They both may have refs/remotes/<same_id> .

Bob:
  $ git branch -d a_branch

Now, Bob has the "I don't want to loose" commit known in
refs/remotes/<same_id> only.

Alice, some time later:
  $ git push -f <same_id> <foo>:<a_branch>

Bob "lose" his commit.

I admit it is a very uncommon use case and Bob can still use the reflog.

-- 
Nicolas Sebrecht