From: Dan Johnson Date: Wed, 25 Jul 2012 20:43:38 GMT Subject: Re: False positive from orphaned_commit_warning() ? Message-ID: In-Reply-To: <20120725185343.GA6937@windriver.com> On Wed, Jul 25, 2012 at 2:53 PM, Paul Gortmaker wrote: > Has anyone else noticed false positives coming from the > orphan check? It is warning me about commits that are > clearly on master. Here is an example, where I checkout > master~2 and then switch back to master. It somehow thinks > that master~2 is orphaned, when master~2 is by definition > in the commit chain leading to master. I've been able to reproduce this with the following simplified recipe, although I still don't know what is causing the failure (I'm not very familiar with the code) git init test cd test #make 3 commits touch a && git add a && git commit -m a touch b && git add b && git commit -m b touch c && git add c && git commit -m c #clone it cd .. git clone test test2 cd test2 git checkout master~2 git checkout master #Warning: you are leaving 1 commit behind, not connected to #any of your branches I can't figure out what's going wrong here, but the clone is important; it doesn't fail without it. It appears to have something to do with the fact that the cloned repository has a remote, as: #in test2 git remote rm origin git checkout master~2 git checkout master Does not throw the warning, but it's not just the presence of origin/master that triggers it, as: cd ../test git remote add origin ../test2 git fetch origin git checkout master~2 git checkout master Does not trigger it either. Confused, -- -Dan