All of lore.kernel.org
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Roland Hieber <rhi@pengutronix.de>,
	git@vger.kernel.org, Vasco Almeida <vascomalmeida@sapo.pt>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] bisect: allow to run from subdirectories
Date: Mon, 21 Jun 2021 02:00:08 +0000	[thread overview]
Message-ID: <YM/yqPsRutV2mUbb@camp.crustytoothpaste.net> (raw)
In-Reply-To: <877dio3vg5.fsf@evledraar.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2128 bytes --]

On 2021-06-21 at 00:35:49, Ævar Arnfjörð Bjarmason wrote:
> 
> On Sun, Jun 20 2021, Roland Hieber wrote:
> 
> > Currently, calling 'git bisect' from a directory other than the top
> > level of a repository only comes up with an error message:
> >
> >     You need to run this command from the toplevel of the working tree.
> >
> > After a glance through the bisect code, there seems to be nothing that
> > relies on the current working directory, and a few hours of bisect usage
> > also didn't turn up any problems. Set the appropriate flag for
> > git-sh-setup to remove the error message.
> >
> > Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> > ---
> >  git-bisect.sh | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/git-bisect.sh b/git-bisect.sh
> > index 6a7afaea8da0..20ba0ee7c18a 100755
> > --- a/git-bisect.sh
> > +++ b/git-bisect.sh
> > @@ -32,6 +32,7 @@ git bisect run <cmd>...
> >  Please use "git help bisect" to get the full man page.'
> >  
> >  OPTIONS_SPEC=
> > +SUBDIRECTORY_OK=1
> >  . git-sh-setup
> >  
> >  _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
> 
> How does this affect out-of-tree scripts that will be run with "git
> bisect run", is the cwd set to the root as they now might expect git to
> check, or whatever subdirectory you ran the "run" from?

I'm also interested in this, specifically as a patch to the
documentation and a corresponding test (and a commit message
justification), since folks will rely on whatever behavior we implement
and we won't want to break it.

We'd probably also want to add a test at least that the user can invoke
git bisect outside of the root of the repository, and maybe that it
performs correct results for at least one or two known cases when
invoked outside of the root.  And I'm also wondering if maybe there are
other cases that deserve a test along with this change.

As for the idea itself, I think it's a good one assuming everything
continues to work.  It will certainly be more convenient for a lot of
people.
-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  reply	other threads:[~2021-06-21  2:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-20 21:38 [PATCH] bisect: allow to run from subdirectories Roland Hieber
2021-06-21  0:35 ` Ævar Arnfjörð Bjarmason
2021-06-21  2:00   ` brian m. carlson [this message]
2021-06-21  2:10     ` Eric Sunshine
2021-06-21  9:33       ` Roland Hieber
2021-06-21 12:45         ` Ævar Arnfjörð Bjarmason
2021-06-21 20:02           ` Eric Sunshine
2021-06-22 15:27           ` Ævar Arnfjörð Bjarmason
2021-06-22  0:09       ` brian m. carlson
2021-06-21  3:43 ` Junio C Hamano
2021-06-23 23:40   ` Jeff King
2021-06-29  1:22     ` Junio C Hamano
2021-06-29  2:00       ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YM/yqPsRutV2mUbb@camp.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=rhi@pengutronix.de \
    --cc=vascomalmeida@sapo.pt \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.