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

Re: Bisect needing to be at repo top-level?

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 17, 2013, 19:20 UTC
Message-ID
<xmqqioxzxnjh.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20130917175813.GA14173@blizzard>
Lukas Fleischer <git@cryptocrack.de> writes:
Show 8 quoted lines
>> Imagine if you start from a subdirectory foo/ but the directory did
>> not exist in the older part of the history of the project.  When
>> bisect needs to check out a revision that was older than the first
>> revision that introduced that subdirectory, what should happen?
>> Worse yet, if "foo" was a file in the older part of the history,
>> what should happen?
>
> If that is the real explanation,

No. As the line you snipped from your quote says, it is just a guess without running "git log -- git-bisect.sh git-bisect-script".

Also it points at things one needs to watch out for and think about when attempting to update "git bisect" to make it possible to run it anywhere in the working tree.

> why do we allow running git-checkout(1)
> from a subdirectory?
Oversight?

At least on Linux, if you checkout a revision with "foo/" directory, chdir to it and then checkout a revision with "foo" file to nuke your current place, I know "git checkout" will happily do so and you will still be in a directory that is connected nowhere. Your ".." is probably pointing at the top-level, but there is no reverse, so "cd ../foo" may or may not work from that state, and it would lead to an interesting confusion.

We may want to check the condition and forbid such a checkout.
Previous: Lukas FleischerNext: Ben Aveling
Message 4 of 11 in “Bisect needing to be at repo top-level?”
  1. Burton, RossSep 17, 2013
  2. Junio C HamanoSep 17, 2013
  3. Lukas FleischerSep 17, 2013
  4. Junio C HamanoSep 17, 2013
  5. Ben AvelingSep 19, 2013
  6. Ben AvelingSep 19, 2013
  7. Junio C HamanoSep 19, 2013
  8. Stefan BellerOct 9, 2013
  9. Jeff KingOct 9, 2013
  10. Stefan BellerOct 9, 2013
  11. Burton, RossSep 17, 2013

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.