[RFC/PATCH 1/3] t6030: show "rev-list --bisect" breakage when bisecting

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

 



In the following commits:

ad3f9a7 Add '--bisect' revision machinery argument
81ee52b Merge branch 'lt/revision-bisect' into next

the '--bisect' argument was added to the revision machinery to easily
use the "bad" and "good" refs from the current bisection in any
command that expect some refs.

The problem was that '--bisect' already had a special meaning for
"git rev-list" outside the revision machinery and now it was eaten by
the revision machinery. So a flag named "bisect" was added to
"struct rev_info" in these commits, so that "git rev-list" outside the
revision machinery could see that "--bisect" had been used and operate
as if "--bisect" had been passed to it.

But the above does not fix everything, and this commit adds a test
case to show that.

Now "git rev-list --bisect BAD --not GOOD" behaves differently
depending on whether we are currently bisecting or not. If we are not
currently bisecting, it uses "BAD --not GOOD" as the bisect refs and
if we are bisecting it uses the bisect refs of the current bisection
as the bisect refs. This means that we don't behave like we used to
when we are bisecting and the reafs passed on the command line to
"git rev-list --bisect" are different from the bisect refs of the
current bisection.

The following commit will fix this regression.

Signed-off-by: Christian Couder <chriscool@xxxxxxxxxxxxx>
---
 t/t6030-bisect-porcelain.sh |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index def397c..88a2877 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -392,6 +392,19 @@ test_expect_success 'bisect does not create a "bisect" branch' '
 	git branch -D bisect
 '
 
+test_expect_failure 'bisect and "rev-list --bisect"' '
+	rev_list2=$(git rev-list --bisect $HASH3 --not $HASH1) &&
+	test "$rev_list2" = "$HASH2" &&
+	rev_list4=$(git rev-list --bisect $HASH7 --not $HASH1) &&
+	test "$rev_list4" = "$HASH4" &&
+	git bisect start $HASH7 $HASH1 &&
+	rev_hash4=$(git rev-parse --verify HEAD) &&
+	test "$rev_hash4" = "$HASH4" &&
+	rev_list2=$(git rev-list --bisect $HASH3 --not $HASH1) &&
+	test "$rev_list2" = "$HASH2" &&
+	git bisect reset
+'
+
 # This creates a "side" branch to test "siblings" cases.
 #
 # H1-H2-H3-H4-H5-H6-H7  <--other
-- 
1.6.5.1.gaf97d


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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]