git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood123@gmail.com>
To: Sangeeta via GitGitGadget <gitgitgadget@gmail.com>, git@vger.kernel.org
Cc: Johannes Schindelin <johannes.schindelin@gmx.de>,
	Sangeeta <sangunb09@gmail.com>
Subject: Re: [PATCH][OUTREACHY] bisect: allow `git bisect` to run from subdirectory
Date: Wed, 21 Oct 2020 14:41:39 +0100	[thread overview]
Message-ID: <2f71d0c4-a5de-c22b-9cbe-a9efcb3cd21d@gmail.com> (raw)
In-Reply-To: <pull.765.git.1603271344522.gitgitgadget@gmail.com>

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. 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)

I'd recommend adding [Outreachy] to the beginning of the first line of 
the commit message as well.

> This commit removes the
> restriction on git bisect to run only from top level directory thereby
> allowing it to run from any subdirectory.
> 
> Signed-off-by: Sangeeta Jain <sangunb09@gmail.com>
> ---
>      [Outreachy] bisect: allow git bisect to run from subdirectory
>      
>      As git rebase was never prevented to run from subdirectory we shouldn't
>      prevent git bisect to run from subdirectories. This commit removes the
>      restriction on git bisect to run only from top level directory thereby
>      allowing it to run from any subdirectory.
>      
>      Signed-off-by: Sangeeta Jain sangunb09@gmail.com [sangunb09@gmail.com]
> 
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-765%2Fsangu09%2Fbisect_fix-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-765/sangu09/bisect_fix-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/765
> 
>   git-bisect.sh               | 1 +
>   t/t6030-bisect-porcelain.sh | 7 +++++++
>   2 files changed, 8 insertions(+)
> 
> 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.

Best Wishes

Phillip

>   _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
> diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
> index aa226381be..6b68cc01d0 100755
> --- a/t/t6030-bisect-porcelain.sh
> +++ b/t/t6030-bisect-porcelain.sh
> @@ -49,6 +49,13 @@ test_expect_success 'bisect starts with only one bad' '
>   	git bisect next
>   '
>   
> +test_expect_success 'bisect runs in a subdirectory' '
> +    mkdir -p subdir &&
> +    git -C subdir bisect start &&
> +    git -C subdir bisect good &&
> +    git -C subdir bisect reset
> +'
> +
>   test_expect_success 'bisect does not start with only one good' '
>   	git bisect reset &&
>   	git bisect start &&
> 
> base-commit: 69986e19ffcfb9af674ae5180689ab7bbf92ed28
> 

  reply	other threads:[~2020-10-21 13:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21  9:09 [PATCH] bisect: allow `git bisect` to run from subdirectory Sangeeta via GitGitGadget
2020-10-21 13:41 ` Phillip Wood [this message]
2020-10-21 16:20   ` [PATCH][OUTREACHY] " Taylor Blau
2020-10-21 19:53     ` Junio C Hamano
2020-10-22  8:52       ` Johannes Schindelin
2020-10-22  9:46         ` Phillip Wood
2020-10-22 16:52           ` Junio C Hamano
2020-10-23 10:59             ` Sangeeta NB
2020-10-23 15:43               ` Junio C Hamano
2020-10-23 15:18             ` Phillip Wood
2020-10-22  8:47   ` Johannes Schindelin
2020-10-22  9:52     ` Phillip Wood
2020-10-22 17:04       ` Junio C Hamano
2020-10-23  8:37         ` Johannes Schindelin

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=2f71d0c4-a5de-c22b-9cbe-a9efcb3cd21d@gmail.com \
    --to=phillip.wood123@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=johannes.schindelin@gmx.de \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=sangunb09@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).