summaryrefslogtreecommitdiff
path: root/tcwg_kernel-bisect.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tcwg_kernel-bisect.sh')
-rwxr-xr-xtcwg_kernel-bisect.sh35
1 files changed, 29 insertions, 6 deletions
diff --git a/tcwg_kernel-bisect.sh b/tcwg_kernel-bisect.sh
index 61876313..24a0917b 100755
--- a/tcwg_kernel-bisect.sh
+++ b/tcwg_kernel-bisect.sh
@@ -198,8 +198,15 @@ if [ x"$res" = x"0" ]; then
first_bad=$(cat .git/BISECT_RUN | head -n 1 | grep "is the first bad commit" | cut -d" " -f 1)
assert [ x"$first_bad" != x"" ]
- last_good=$(git rev-parse $first_bad^)
- if ! grep -q $last_good "$artifacts/good_revs"; then
+ for last_good in $(git rev-parse $first_bad^@); do
+ if grep -q $last_good "$artifacts/good_revs"; then
+ # One of immediate parrents of $first_bad tested good.
+ break
+ fi
+ last_good=""
+ done
+ if [ x"$last_good" = x"" ]; then
+ # None of immediate parents of $first_bad tested as good.
# 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,
@@ -208,10 +215,26 @@ if [ x"$res" = x"0" ]; 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.
- echo "Testing last_good $last_good (hoping for success)"
- git checkout --detach "$last_good"
- $artifacts/test.sh &
- res=0 && wait $! || res=$?
+ res=0
+ for last_good in $(git rev-parse $first_bad^@); do
+ if grep -q $last_good "$artifacts/bad_revs" "$artifacts/skipped_revs"; then
+ echo "First_bad's parent $last_good has tested bad or skipped"
+ last_good=""
+ continue
+ fi
+ if [ x"$(git merge-base $merge_base $last_good)" != x"$merge_base" ]; then
+ echo "First_bad's parent $last_good is outside of bisect scope"
+ last_good=""
+ continue
+ fi
+ echo "Testing first_bad's parent $last_good (hoping for success)"
+ git checkout --detach "$last_good"
+ $artifacts/test.sh &
+ res=0 && wait $! || res=$?
+ if [ x"$res" = x"0" ]; then
+ break
+ fi
+ done
if [ x"$res" != x"0" ]; then
# It seems $last_good was on a path that tested good, even though
# it itself is bad. We re-trigger the bisection job with updated