diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-04-07 13:03:57 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-04-07 13:16:50 +0000 |
commit | 169f17939a51bf5ac3de82f28064aa8675bd8792 (patch) | |
tree | bc7308d477d40cac4de340bc8bc020e2c2f14aa4 /round-robin-bisect.sh | |
parent | 04fa208c27f49064a8fb2bcd564e64b692043112 (diff) |
round-robin-bisect.sh: Handle another edge case
... in bisection of merge history. We can detect first_bad commit
with a good parent that is outside of bisection range. E.g.,
BAD
| \
BASE \
| FIRST BAD
| /
PARENT
In this case PARENT is the last good revision, but falls outside
of bisection range.
Change-Id: I4b88b6c7a245f390705df70943cccd70964fd7f6
Diffstat (limited to 'round-robin-bisect.sh')
-rwxr-xr-x | round-robin-bisect.sh | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/round-robin-bisect.sh b/round-robin-bisect.sh index a6a8511f..96619b99 100755 --- a/round-robin-bisect.sh +++ b/round-robin-bisect.sh @@ -407,10 +407,6 @@ if [ x"$first_bad" != x"" ]; then last_good="" bad_last_good="" for sha1 in $(git rev-parse $first_bad^@); do - # 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 # the basis of one of its children being "good". Therefore we # can have a situation when we have parent P with children C1 and C2, @@ -419,6 +415,23 @@ if [ x"$first_bad" != x"" ]; then # and it knows CB is "bad", so git-bisect returns C1 as the first bad # commit. # To simplify investigations we explicitly test parent of $first_bad. + + # Ignore commits outside of bisection range, but make an exception + # for commits that weren't tested due to their child tested good. + # This happens in projects that actively use merges, e.g., linux. + if ! grep -q "^$sha1\$" $commits_in_range; then + child_tested_good=false + for tested_good in $(print_tested_revs good); do + if git merge-base --is-ancestor $sha1 $tested_good; then + child_tested_good=true + break + fi + done + if ! $child_tested_good; then + continue + fi + fi + echo "Testing first_bad's parent $sha1 (hoping for success)" git checkout --detach "$sha1" $artifacts/test.sh & |