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
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Oct 22, 2020, 09:52 UTC
Message-ID
<46b208d8-3741-d528-c833-aea5770a502c@gmail.com>
In-Reply-To
<nycvar.QRO.7.76.6.2010221042260.56@tvgsbejvaqbjf.bet>
Hi Dscho and Sangeeta
On 22/10/2020 09:47, Johannes Schindelin wrote:
Show 22 quoted lines
> Hi Phillip,
> 
> On Wed, 21 Oct 2020, Phillip Wood wrote:
> 
>> Hi Sangeeta
>>
>> It's great to see you tackling another patch
>>
>> On 21/10/2020 10:09, Sangeeta via GitGitGadget wrote:
>>> From: Sangeeta Jain <sangunb09@gmail.com>
>>>
>>> As `git rebase` was never prevented to run from subdirectory we shouldn't
>>> prevent `git bisect` to run from subdirectories.
>>
>> I'm not sure it's relevant to bisect whether or not rebase can be run from a
>> subdirectory.
> 
> The relevance is this: _iff_ we want to prevent `git bisect` from running
> in a subdirectory under the premise that that subdirectory might need to
> be removed, then why don't we prevent `git rebase` from running in a
> subdirectory when that command is equally likely to remove that
> subdirectory?
That's a good point, I'd completely missed the analogy with `rebase --exec`
Show 15 quoted lines
>> What is important is that we want all commands to be able to be run from
>> a subdirectory unless there is a good reason not to (and there isn't for
>> bisect)
> 
> There is a difference in quality here, though. If you run, say, `git
> fetch` in a subdirectory, or `git commit` or `git show`, there is not the
> same worry that that subdirectory will go away as with `git bisect`, `git
> rebase`, `git switch`, `git pull` and other commands.
> 
>> I'd recommend adding [Outreachy] to the beginning of the first line of
>> the commit message as well.
> 
> I am opposed to that. The fact that this comes in via Outreachy is
> interesting at the moment, for reviewers, but not for posterity (i.e. in
> the commit that will make it into the commit history).
I thought `am` would strip [Outreachy] the same way as it strips [PATCH]
Show 20 quoted lines
>>> diff --git a/git-bisect.sh b/git-bisect.sh
>>> index ea7e684ebb..9cd0fa0483 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=Yes
>>>    . git-sh-setup
>>
>> `git bisect run` takes an optional script that is run to determine if the
>> current commit is good or bad. If the script is given with a relative path
>> then we need to make sure it is invoked from the subdirectory that `git bisect
>> run` was started from. As far as I can see git-bisect.sh does not change
>> directory but it would be good to have a test for `git bisect run <cmd>` from
>> a subdirectory.
> 
> That's a very good point. We should first add a regression test for
> exactly that use case, and then make sure that it passes.

Though I'm now wondering if we should be running the command from the repository root directory like rebase[1]

Best Wishes
Phillip

[1] https://lore.kernel.org/git/cfe33eef-974d-8ff9-ebb4-d1153abd497c@gmail.com

> Ciao,
> Dscho
> 
Previous: Johannes SchindelinNext: Junio C Hamano
Message 12 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.