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

[PATCH] bisect: allow `git bisect` to run from subdirectory

From
Sangeeta via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 21, 2020, 09:09 UTC
Message-ID
<pull.765.git.1603271344522.gitgitgadget@gmail.com>
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. 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
 
 _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
-- 
gitgitgadget
Next: Phillip Wood
Message 1 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.