summaryrefslogtreecommitdiff
path: root/round-robin-bisect.sh
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-04-01 08:52:27 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-04-01 08:55:20 +0000
commitd3e84bd42ef82b54a1d27adf2540a29610539c35 (patch)
tree6a84e0f0a75a84be885c0884b49f1057971c3004 /round-robin-bisect.sh
parent00301b92b2448d74417214a5665db62326047e25 (diff)
round-robin-bisect.sh: Fix handling of an edge case
... when first_bad commit is the child of baseline_rev. In this case baseline_rev was not in orig_commits_to_test and we failed on "Broken bisection range" assert. Fix by adding all previously tested revisions to orig_commits_to_test, which is renamed to commits_in_range. Change-Id: Iad37dbdb24bcddf42721dc8526b5b63a64653624
Diffstat (limited to 'round-robin-bisect.sh')
-rwxr-xr-xround-robin-bisect.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/round-robin-bisect.sh b/round-robin-bisect.sh
index 1fe4df34..a6a8511f 100755
--- a/round-robin-bisect.sh
+++ b/round-robin-bisect.sh
@@ -323,6 +323,9 @@ get_first_bad ()
)
}
+# Print revs tested during bisect.
+# $1 -- Revision kind -- good/bad/skip.
+# Print all revisions if no $1 given.
print_tested_revs ()
{
(
@@ -331,8 +334,8 @@ print_tested_revs ()
# excplicitly set "+o pipefail".
set -euf +o pipefail
- local kind="$1"
- git bisect log | grep "^git bisect $1 " | sed -e "s/^git bisect $1 //"
+ local kind="${1-[a-z]*}"
+ git bisect log | grep "^git bisect $kind " | sed -e "s/^git bisect $kind //"
)
}
@@ -342,8 +345,13 @@ touch ../interesting-commits/$current_project
# Generate list of commits inside the bisection range.
commits_to_test=$artifacts/git-logs/commits_to_test
git bisect view --pretty=%H > $commits_to_test
-orig_commits_to_test=$artifacts/git-logs/orig_commits_to_test
-cp $commits_to_test $orig_commits_to_test
+
+# Record commits in the bisect range. These are commits_to_test plus
+# commits that have been tested.
+commits_in_range=$artifacts/git-logs/commits_in_range
+cp $commits_to_test $commits_in_range
+print_tested_revs >> $commits_in_range
+
# This loop can generate lots of console noise.
set +x
while [ x"$(get_first_bad </dev/null)" = x"" ] && read -a arr; do
@@ -399,8 +407,8 @@ if [ x"$first_bad" != x"" ]; then
last_good=""
bad_last_good=""
for sha1 in $(git rev-parse $first_bad^@); do
- # Ignore commits outside of original bisection range.
- if ! grep -q "^$sha1\$" $orig_commits_to_test; then
+ # Ignore commits outside of bisection range.
+ if ! grep -q "^$sha1\$" $commits_in_range; then
continue
fi
# It seems that git-bisect assumes parent commit as "good" on