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

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

From
Christian Couder <chriscool@tuxfamily.org>
Date
Nov 4, 2009, 04:00 UTC
Message-ID
<20091104040004.4545.36317.chriscool@tuxfamily.org>
In-Reply-To
<20091104034312.4545.2176.chriscool@tuxfamily.org>
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@tuxfamily.org>
---
 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
Previous: Christian CouderNext: Christian Couder
Message 2 of 11 in “use '--bisect-refs' as bisect rev machinery option”
  1. 0/3 use '--bisect-refs' as bisect rev machinery optionChristian Couder, Nov 4, 2009
  2. 1/3 t6030: show "rev-list --bisect" breakage when bisectingChristian Couder, Nov 4, 2009
  3. 2/3 revision: change '--bisect' rev machinery argument to 'bisect-refs'Christian Couder, Nov 4, 2009
  4. 3/3 bisect: simplify calling visualizer using '--bisect-refs'Christian Couder, Nov 4, 2009
  5. Junio C HamanoNov 4, 2009
  6. Linus TorvaldsNov 4, 2009
  7. Linus TorvaldsNov 4, 2009
  8. Junio C HamanoNov 4, 2009
  9. Christian CouderNov 4, 2009
  10. Junio C HamanoNov 4, 2009
  11. Christian CouderNov 5, 2009

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.