]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Meta/cycle-run: avoid testing the same tree twice
authorJunio C Hamano <gitster@pobox.com>
Tue, 6 Apr 2021 23:21:59 +0000 (16:21 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 6 Apr 2021 23:21:59 +0000 (16:21 -0700)
cycle-run

index 6e8b3520470d2e00ed9706002e5c3e493e83b7ed..f2aa2ec636e15524952b08c24394e8e1006a1f1a 100755 (executable)
--- a/cycle-run
+++ b/cycle-run
@@ -41,24 +41,30 @@ test_it () {
        esac
 }
 
+tested () {
+       # sign=$1 commit=$2
+       egrep "^$OKNG $1($2|$(git rev-parse "$2^{tree}"))" .Cycle/log >/dev/null
+}
+
 test_them () {
        while read merge parent sides
        do
                case "$parent" in
                ?*)
-                       egrep "^$OKNG M$merge" .Cycle/log >/dev/null && continue
+                       tested M $merge && continue
                        echo "TEST M $merge"
+
                        for tip in $sides
                        do
                                git rev-parse --verify --quiet "$tip" || continue
-                               egrep "^$OKNG T$tip" .Cycle/log >/dev/null && continue
+                               tested T $tip && continue
                                echo "TEST $tip $merge"
                        done
                        ;;
                '')
                        commit=$merge
                        git rev-parse --verify --quiet "$commit" || continue
-                       egrep "^$OKNG C$commit" .Cycle/log >/dev/null ||
+                       tested C $commit && continue
                        echo "TEST C $commit"
                esac
        done |
@@ -97,6 +103,7 @@ test_them () {
                        OK=NG
                fi
                echo "$OK $type$commit $count" >>.Cycle/log
+               echo "$OK $type$(git rev-parse $commit^{tree}) $count" >>.Cycle/log
                echo >&2 "$count/$total $OK $subject"
                count=$(( $count - 1 ))
        done <.Cycle/plan