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

Re: git-bisect working only from toplevel dir

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 23, 2011, 19:09 UTC
Message-ID
<7vd3cibqqe.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20111123145034.GB17927@angband.pl>
Adam Borowski <kilobyte@angband.pl> writes:
Show 5 quoted lines
> The requirement to be in the toplevel directory when calling git-bisect is
> pretty infuriating.  I tried to find an explanation for this, and the only
> reference I found was:
>
> http://thread.gmane.org/gmane.comp.version-control.git/27524/focus=27596

Interesting. It used to be that people were thankful when a command happened to work from a subdirectory, and it was a minor irritation when some command didn't; in the early days, everything in Git was to be used from the top-legvel.

Show 5 quoted lines
> However, since then, git-reset has been changed (in a81c311f).  What about
> changing git-bisect as well?
>
> A trivial patch seems to work for me, but I might have missed some corner
> case.

Thanks; read and follow Documentation/SubmittingPatches the next time perhaps?

As to the approach, I suspect that it would be far better if it made workable with cd_to_toplevel at the beginning, instead of saying SUBDIRECTORY_OK.

After all, the current directory may disappear during the course of bisection, upon checking out a revision that did not have the directory you started your bisection from.

Show 26 quoted lines
>
> -- 
> 1KB		// Yo momma uses IPv4!
>
> From 1dd5dda6a9db3d987e15784c4de24e593cc596e0 Mon Sep 17 00:00:00 2001
> From: Adam Borowski <kilobyte@angband.pl>
> Date: Wed, 23 Nov 2011 15:08:42 +0100
> Subject: [PATCH] git-bisect: allow using it from a subdirectory.
>
> Just like git-reset, restricting it to toplevel is an annoyance, and the
> latter has been changed in a81c311f.
> ---
>  git-bisect.sh |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/git-bisect.sh b/git-bisect.sh
> index 99efbe8..fd6ccdd 100755
> --- a/git-bisect.sh
> +++ b/git-bisect.sh
> @@ -27,6 +27,7 @@ git bisect run <cmd>...
>  Please use "git help bisect" to get the full man page.'
>  
>  OPTIONS_SPEC=
> +SUBDIRECTORY_OK=Yes
>  . git-sh-setup
>  . git-sh-i18n
Previous: Adam BorowskiNext: Jeff King
Message 2 of 11 in “git-bisect working only from toplevel dir”
  1. Adam BorowskiNov 23, 2011
  2. Junio C HamanoNov 23, 2011
  3. Jeff KingNov 23, 2011
  4. Adam BorowskiNov 23, 2011
  5. Jeff KingNov 23, 2011
  6. Peter BaumannNov 23, 2011
  7. Jeff KingNov 23, 2011
  8. Junio C HamanoNov 23, 2011
  9. Peter BaumannNov 24, 2011
  10. Junio C HamanoNov 24, 2011
  11. Jeff KingNov 29, 2011

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.