Re: [PATCH] bisect: allow to run from subdirectories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
> > ---
> >  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: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux