Re: [BUG?] git checkout -b removes MERGE_HEAD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 18, 2010 at 10:39:31AM -0800, Junio C Hamano wrote:

> I think it was an oversight by the author of 91dcdfd (Make "git checkout"
> create new branches on demand, 2005-07-11) who forgot that he also did
> ef0bfa2 (Remove MERGE_HEAD in "git checkout/reset", 2005-06-21).  The
> rationale for the removal of MERGE_HEAD from the earlier commit is:
> 
>     [this command] will end up resetting the index to some specific
>     head, and any unresolved merge will be forgotten [hence there is no
>     point recording the result as a merge].
> 
> but when used with -b no such "resetting of the index" happens.

It is not necessarily about "-b" is it? It is about moving to a
different commit. So I would think that on branch "master":

  # should clear MERGE_HEAD
  git checkout foo

  # should not clear MERGE_HEAD; it's a no-op, and we have in the past
  # encouraged people to run this to see the ahead/behind count
  git checkout
  # or
  git checkout master

  # should clear MERGE_HEAD; we are moving to a new commit
  git checkout -b foo some_commit

  # should not clear MERGE_HEAD; this is Jan's case
  git checkout -b foo
  # or
  git checkout -b foo master

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]