git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: False positive from orphaned_commit_warning() ?

From
Dan Johnson <computerdruid@gmail.com>
Date
Jul 25, 2012, 20:43 UTC
Message-ID
<CAPBPrnugVm0RS5+Ljgg2E-AJygYsOSRjZW0Z=o9Mavs-SxTBog@mail.gmail.com>
In-Reply-To
<20120725185343.GA6937@windriver.com>

On Wed, Jul 25, 2012 at 2:53 PM, Paul Gortmaker <paul.gortmaker@windriver.com> wrote:

Show 6 quoted lines
> 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
Previous: Paul GortmakerNext: Junio C Hamano
Message 2 of 7 in “False positive from orphaned_commit_warning() ?”
  1. Paul GortmakerJul 25, 2012
  2. Dan JohnsonJul 25, 2012
  3. Junio C HamanoJul 25, 2012
  4. Jeff KingJul 25, 2012
  5. Junio C HamanoJul 25, 2012
  6. Jeff KingJul 25, 2012
  7. Paul GortmakerJul 26, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.