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

[PATCH] bisect: Fix log output for multi-parent skip ranges

From
Torstein Hegge <hegge@resisty.net>
Date
May 22, 2013, 22:27 UTC
Message-ID
<20130522222753.GD5357@pvv.ntnu.no>
In-Reply-To
<20130422210229.GE5650@pvv.ntnu.no>
On Mon, Apr 22, 2013 at 23:02:29 +0200, Torstein Hegge wrote:
> There has to be a better way to get the range of possible first bad
> commits, similar to the output of 'git log --bisect --format="%H"'.

I just realized that this felt clunky because I didn't understand what '--not' does in git rev-list.

In the case where the range of skipped commits include a merge and points in each parent marked good, I want

    git rev-list bad --not good-1 good-2
or 
    git rev-list bad ^good-1 ^good-2
but instead I did
    git rev-list bad --not good-1 --not good-2

which will include commits outside the range of skipped commits. Sorry about that :/

--- >8 ---
Subject: [PATCH] bisect: Fix log output for multi-parent skip ranges

The bisect log output of skipped commits introduced in f989cac "bisect: Log possibly bad, skipped commits at bisection end" should obtain the range of skipped commits from

    git rev-list bad --not good-1 good-2
not
    git rev-list bad --not good-1 --not good-2
when the skipped range contains a merge with good points in each parent.
Signed-off-by: Torstein Hegge <hegge@resisty.net>
---
 git-bisect.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-bisect.sh b/git-bisect.sh
index d7518e9..9f064b6 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -320,8 +320,8 @@ bisect_next() {
 	elif test $res -eq 2
 	then
 		echo "# only skipped commits left to test" >>"$GIT_DIR/BISECT_LOG"
-		good_revs=$(git for-each-ref --format="--not %(objectname)" "refs/bisect/good-*")
-		for skipped in $(git rev-list refs/bisect/bad $good_revs)
+		good_revs=$(git for-each-ref --format="%(objectname)" "refs/bisect/good-*")
+		for skipped in $(git rev-list refs/bisect/bad --not $good_revs)
 		do
 			skipped_commit=$(git show-branch $skipped)
 			echo "# possible first bad commit: $skipped_commit" >>"$GIT_DIR/BISECT_LOG"
-- 
1.8.3.rc1.377.g7010c6b
Previous: Christian CouderNext: Junio C Hamano
Message 10 of 11 in “bisect: Store first bad commit as comment in log file”
  1. bisect: Store first bad commit as comment in log fileTorstein Hegge, Apr 13, 2013
  2. Christian CouderApr 15, 2013
  3. Torstein HeggeApr 15, 2013
  4. Junio C HamanoApr 15, 2013
  5. Torstein HeggeApr 22, 2013
  6. Junio C HamanoApr 22, 2013
  7. Torstein HeggeApr 22, 2013
  8. Junio C HamanoApr 22, 2013
  9. Christian CouderApr 25, 2013
  10. bisect: Fix log output for multi-parent skip rangesTorstein Hegge, May 22, 2013
  11. Junio C HamanoApr 15, 2013

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.