aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2007-04-04 07:12:02 +0200
committerJunio C Hamano <junkio@cox.net>2007-04-05 15:13:14 -0700
commit38a47fd6e316030ba1e72ea447243cb47adf2505 (patch)
tree365abc710b3f7ad43bc2cb70c590a500eeeb85e0 /t
parent33580fbd308593e36395926fd35b501976ad322a (diff)
downloadgit-38a47fd6e316030ba1e72ea447243cb47adf2505.tar.gz
git-38a47fd6e316030ba1e72ea447243cb47adf2505.tar.xz
Bisect: teach "bisect start" to optionally use one bad and many good revs.
One bad commit is fundamentally needed for bisect to run, and if we beforehand know more good commits, we can narrow the bisect space down without doing the whole tree checkout every time we give good commits. This patch implements: git bisect start [<bad> [<good>...]] [--] [<pathspec>...] as a short-hand for this command sequence: git bisect start git bisect bad $bad git bisect good $good1 $good2... On the other hand, there may be some confusion between revs (<bad> and <good>...) and <pathspec>... if -- is not used and if an invalid rev or a pathspec that looks like a rev is given. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't')
-rwxr-xr-xt/t6030-bisect-run.sh20
1 files changed, 17 insertions, 3 deletions
diff --git a/t/t6030-bisect-run.sh b/t/t6030-bisect-run.sh
index 39c72283b..455dc6081 100755
--- a/t/t6030-bisect-run.sh
+++ b/t/t6030-bisect-run.sh
@@ -40,8 +40,8 @@ test_expect_success \
# We want to automatically find the commit that
# introduced "Another" into hello.
test_expect_success \
- 'git bisect run simple case' \
- 'echo "#!/bin/sh" > test_script.sh &&
+ '"git bisect run" simple case' \
+ 'echo "#"\!"/bin/sh" > test_script.sh &&
echo "grep Another hello > /dev/null" >> test_script.sh &&
echo "test \$? -ne 0" >> test_script.sh &&
chmod +x test_script.sh &&
@@ -49,7 +49,21 @@ test_expect_success \
git bisect good $HASH1 &&
git bisect bad $HASH4 &&
git bisect run ./test_script.sh > my_bisect_log.txt &&
- grep "$HASH3 is first bad commit" my_bisect_log.txt'
+ grep "$HASH3 is first bad commit" my_bisect_log.txt &&
+ git bisect reset'
+
+# We want to automatically find the commit that
+# introduced "Ciao" into hello.
+test_expect_success \
+ '"git bisect run" with more complex "git bisect start"' \
+ 'echo "#"\!"/bin/sh" > test_script.sh &&
+ echo "grep Ciao hello > /dev/null" >> test_script.sh &&
+ echo "test \$? -ne 0" >> test_script.sh &&
+ chmod +x test_script.sh &&
+ git bisect start $HASH4 $HASH1 &&
+ git bisect run ./test_script.sh > my_bisect_log.txt &&
+ grep "$HASH4 is first bad commit" my_bisect_log.txt &&
+ git bisect reset'
#
#