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

Re: [PATCH] bisect: remove root directory restriction for git bisect

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 23, 2020, 16:02 UTC
Message-ID
<nycvar.QRO.7.76.6.2003231658450.46@tvgsbejvaqbjf.bet>
In-Reply-To
<20200322104826.GB2224@szeder.dev>
Hi Gábor,
On Sun, 22 Mar 2020, SZEDER Gábor wrote:
Show 9 quoted lines
> On Sun, Mar 22, 2020 at 09:15:47AM +0000, Sheikh hamza via GitGitGadget wrote:
> > From: sheikh hamza <sheikhhamza012@gmail.com>
> >
> > the git bisect
> >     command should be able to run from inside any
> >     subdirectory
>
> Why should 'git bisect' be able to run from inside any subdirectory
> (of the working tree, I presume)?

Because other commands also allow the user to run in a subdirectory. For example, `git rebase`, `git checkout`, `git cherry-pick`, etc

Show 5 quoted lines
> In particular, what happens, if someone starts 'git bisect' from within
> 'subdir/', and 'git bisect' then checks out an old commit, where said
> 'subdir/' didn't exist?  What happens, if the user runs 'git bisect run
> ./script' from within 'subdir/', and that 'subdir/' doesn't exist in
> that old commit?

The same that happens if that situation arises in `git rebase` or `git checkout`: the directory is removed unless it is not empty (i.e. if there are untracked files in the directory, or submodules).

> What happens, if 'subdir' does exists in that old commit, but it's a
> file, not a directory?  What happens, if all this is on Windows?

On Windows, the directory is not deletable, of course, and the same thing happens as if an untracked file is still in that directory: it is not deleted.

> >  git-bisect.sh            | 1 +
> >  t/perf/bisect_regression | 6 ++----
> >  2 files changed, 3 insertions(+), 4 deletions(-)

The most obvious problem with this patch is that it is not accompanied by a regression test that documents and verifies the intended behavior.

Ciao, Dscho

Previous: sheikh hamzaNext: Junio C Hamano
Message 6 of 7 in “bisect: remove root directory restriction for git bisect”
  1. bisect: remove root directory restriction for git bisectSheikh hamza via GitGitGadget, Mar 22, 2020
  2. SZEDER GáborMar 22, 2020
  3. sheikh hamzaMar 22, 2020
  4. sheikh hamzaMar 22, 2020
  5. sheikh hamzaMar 22, 2020
  6. Johannes SchindelinMar 23, 2020
  7. Junio C HamanoMar 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.