Re: [bug] git checkout lies about number of ahead commits when switching from detached HEAD
- From
Jeff King <peff@peff.net>
- Date
- Mar 19, 2011, 22:28 UTC
- Message-ID
- <20110319222852.GB7116@sigill.intra.peff.net>
- In-Reply-To
- <4D8525C9.2060203@gmail.com>
On Sat, Mar 19, 2011 at 10:53:13PM +0100, Piotr Krukowiecki wrote:
Show 16 quoted lines
> It says "by 0 commits" when going back from detached HEAD to > master branch: > > > $ git checkout HEAD^ > > $ git checkout master > Previous HEAD position was af4c62a... Merge branch 'maint' > Switched to branch 'master' > Your branch is ahead of 'origin/master' by 0 commits. > ^^^^^^^^^^^^ > > $ git status > # On branch master > # Your branch is ahead of 'origin/master' by 1 commit. > ^^^^^^^^^^^
Hmm. My guess is that the new "check for connectivity when leaving detached HEAD" test is polluting the commit flags for the ahead/behind test.
[bisect bisect bisect]
Yep, it bisects to 8e2dc6a (commit: give final warning when reattaching HEAD to leave commits behind, 2011-02-18). We probably need to clean the uninteresting flags between the two traversals.
-Peff