On Wed, Jul 25, 2012 at 2:53 PM, Paul Gortmaker
<paul.gortma...@windriver.com> 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.

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

Reply via email to