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 <he...@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

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

Reply via email to