From efcea26a1132e8a56553ddaaca0db44310f6383f Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Mon, 10 Feb 2020 14:10:57 +0000 Subject: Make sure the sources are clean before bisecting It can happen that some of the source files are modified during a build, which causes 'git bisect' commands to abort. This patch introduces calls 'git reset --hard' after completing a build, as suggested by the 'git bisect' manpage, to avoid this problem. For reference this happened recently in GCC, where gcc/config/arm/arm-tables.opt was modified. That bug has been fixed, but we can still suffer from it while bisecting. Change-Id: Ib9b7c8c7d26a9c7ba1361174fa061f97e3d88843 --- round-robin-bisect.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'round-robin-bisect.sh') diff --git a/round-robin-bisect.sh b/round-robin-bisect.sh index af984147..97cf220e 100755 --- a/round-robin-bisect.sh +++ b/round-robin-bisect.sh @@ -92,6 +92,9 @@ cd $current_project mkdir $artifacts/git-logs +# Make sure the sources are clean before bisecting +git reset --hard + if [ -f "$replay_log" ]; then cp "$replay_log" $artifacts/git-logs/bisect_replay.sh git bisect replay $artifacts/git-logs/bisect_replay.sh @@ -156,6 +159,8 @@ $build_script \ --verbose "$verbose" & res=0 && wait \$! || res=\$? +git reset --hard + if [ x"\$res" != x"0" ]; then if [ -f $rel_artifacts/build-\$rev/trigger-build-$current_project ]; then exit 1 -- cgit v1.2.3