diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-01-05 17:50:56 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-01-05 19:02:33 +0000 |
commit | 8bdc7c170b20821233d8859f8b677ca0a9f568ce (patch) | |
tree | f3f8bbc6114daae8974d08cbee9e7c5615473ae4 | |
parent | a9ee3b7ffefed2b7422812f84c02952b18a39668 (diff) |
round-robin-bisect.sh: Simplify filtering of interesting commits
Turns out "git bisect view --pretty=%H" does most of this work
for us, so no need to check ancestors of good/bad commits.
Change-Id: I405c8e29810da11ff65e0605be5b2dd6bb61ca3e
-rwxr-xr-x | round-robin-bisect.sh | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/round-robin-bisect.sh b/round-robin-bisect.sh index 527bc79f..8a49e0c0 100755 --- a/round-robin-bisect.sh +++ b/round-robin-bisect.sh @@ -341,8 +341,6 @@ print_tested_revs () # identified in other configurations. touch ../interesting-commits/$current_project # Generate list of commits inside the bisection range. -# It's surprising how expensive beloow "--is-ancestor" checks are, and it's -# a good optimization to skip commits outside of our bisect range quickly. commits_to_test=$artifacts/git-logs/commits_to_test git bisect view --pretty=%H > $commits_to_test # This loop can generate lots of console noise. @@ -353,43 +351,20 @@ while [ x"$(get_first_bad </dev/null)" = x"" ] && read -a arr; do sha1="${arr[0]}" + # Ignore commits outside of bisection range. if ! grep -q "^$sha1\$" $commits_to_test; then - # Commit is outside of bisection range. # shellcheck disable=SC2106 continue fi - # Skip $bad_rev and $baseline_rev, these were already tested. + # Skip revisions that were already tested. Good revisions are filtered + # out in the above $commits_to_test check, and here we filter out + # "bad" and "skip" revisions. if git bisect log | grep -q "^git bisect .* $sha1\$"; then # shellcheck disable=SC2106 continue fi - # Maintain "git bisect" invariant: all good revisions are ancestors - # of all bad revisions. If we [forcefully] test a revision for - # which the invariant doesn't hold, then "git bisect" will fail. - skip=false - for tested_bad in $(print_tested_revs bad); do - if ! git merge-base --is-ancestor $sha1 $tested_bad; then - skip=true - break - fi - done - if $skip; then - # shellcheck disable=SC2106 - continue - fi - for tested_good in $(print_tested_revs good); do - if git merge-base --is-ancestor $sha1 $tested_good; then - skip=true - break - fi - done - if $skip; then - # shellcheck disable=SC2106 - continue - fi - if $verbose; then set -x; fi git checkout --detach $sha1 |