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

Re: [PATCH][OUTREACHY] bisect: allow `git bisect` to run from subdirectory

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 22, 2020, 08:52 UTC
Message-ID
<nycvar.QRO.7.76.6.2010221047550.56@tvgsbejvaqbjf.bet>
In-Reply-To
<xmqqr1pr73ve.fsf@gitster.c.googlers.com>
Hi Junio,
On Wed, 21 Oct 2020, Junio C Hamano wrote:
Show 24 quoted lines
> Taylor Blau <me@ttaylorr.com> writes:
>
> > I'm not sure that that's the case: Junio pointed out a while[1] ago that
> > we'd have to answer the question of "what happens if I'm in a
> > subdirectory that goes away during some point of the bisection?". I
> > think that you could probably find an answer to that question, but the
> > fact that there isn't an obvious one seems to indicate that we're going
> > down the wrong path.
> >
> > I agree that it would be nice to run bisect from any directory, but it
> > may not be as easy as I'd hope.
>
> True.
>
> I would not mind all that much a single "git checkout ancient" that
> makes the $cwd go away and confuse the user.  But a bisect session
> would jump around versions randomly (eh, logarithmically?) and you'd
> end up switching out of a version in a non-existing $cwd to another
> version that has the directory (created internally by mkdir(2)), and
> I'm fairly certain that your phantom $cwd that is not connected to
> any other filesystem entity and the directory that should be at the
> same path in the newly checked-out version are different filesystem
> entities.  I'd rather not have to think about the interaction
> between git and the system after that point.

By that token, we should also prevent `git rebase` from running in a subdirectory, but we don't.

Besides, this only becomes an issue when the directory becomes _empty_ (including untracked files) because we don't remove it otherwise.

I am actually more worried about bisecting between revisions that replace the current subdirectory by a symlink or something.

But again, this is pretty much precisely the kind of scenario that we _already_ allow running into with `git rebase`. So I see little point refusing `git bisect` users to run in a subdirectory.

I know that _I_ often grumble after `git bisect start` fails, then try to pull out the last remains of my patience and insert `-C ..` or `-C ../..` between `git` and `bisect` and _still_ get what I want, all while shaking my imaginary fist at `git bisect` for forcing me to type those extra keystrokes.

Ciao, Dscho

Previous: Junio C HamanoNext: Phillip Wood
Message 5 of 14 in “bisect: allow `git bisect` to run from subdirectory”
  1. bisect: allow `git bisect` to run from subdirectorySangeeta via GitGitGadget, Oct 21, 2020
  2. Phillip WoodOct 21, 2020
  3. Taylor BlauOct 21, 2020
  4. Junio C HamanoOct 21, 2020
  5. Johannes SchindelinOct 22, 2020
  6. Phillip WoodOct 22, 2020
  7. Junio C HamanoOct 22, 2020
  8. Sangeeta NBOct 23, 2020
  9. Junio C HamanoOct 23, 2020
  10. Phillip WoodOct 23, 2020
  11. Johannes SchindelinOct 22, 2020
  12. Phillip WoodOct 22, 2020
  13. Junio C HamanoOct 22, 2020
  14. Johannes SchindelinOct 23, 2020

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.