From 1a60129203bf7933a360230e62cca84d9e8a00e7 Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Wed, 20 Feb 2019 12:27:49 +0000 Subject: round-robin.sh: Fix base-artifacts grooming in update_baseline To have a history of pending regressions we mark baseline resets with reset-baseline file/marker (remember that resets correspond to "first-bad" builds triggered by bisect job). We have mistakenly tried to look for reset-baseline markers in the current revision of base-artifacts, while we should have looked in $prev_head revision. This patch fixes this and simplifies overall grooming of regression history. Change-Id: I3a819e6dfcdc2e8f02370216db001c00c067912b --- round-robin.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/round-robin.sh b/round-robin.sh index 8227d38e..1512ca0e 100644 --- a/round-robin.sh +++ b/round-robin.sh @@ -372,23 +372,24 @@ update_baseline () # the current one, but keep entries for results that are better # (so that we have a record of pending regressions). while no_regression_p; do + prev_head="" if git -C base-artifacts rev-parse HEAD^ >/dev/null 2>&1; then - prev_head=$(git -C base-artifacts rev-parse HEAD) + # For every regression we want to keep artifacts for the first-bad + # build, so reset to the most relevant regression (marked by reset-baseline). + if [ -f base-artifacts/reset-baseline ] && ! ${rr[reset_baseline]}; then + prev_head=$(git -C base-artifacts rev-parse HEAD) + fi git -C base-artifacts reset --hard HEAD^ else # We got to the beginning of git history, so amend the current # commit. The initial state of baseline is "empty" branch, # which we treat as worst possible in no_regression_p(). amend="--amend" - prev_head="" break fi done - # For every regression we want to keep artifacts for the first-bad - # build, so discard one less than needed. - if [ x"$prev_head" != x"" -a -f base-artifacts/reset-baseline ] \ - && ! ${rr[reset_baseline]}; then + if [ x"$prev_head" != x"" ]; then git -C base-artifacts reset --hard $prev_head fi -- cgit v1.2.3