33SCRIPT_DIR=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd )
44BASE_DIR=$( dirname $SCRIPT_DIR )
55branch=$( git rev-parse --abbrev-ref HEAD)
6- br_commit=$( git rev-parse $branch )
7- main_commit=$( git rev-parse main)
6+ # br_commit=$(git rev-parse $branch)
7+ # main_commit=$(git rev-parse main)
88echo " Comparing main branch with $branch "
99
1010build_branch () {
1111 dir_name=$1
1212 if [ ! -d $dir_name ]; then
1313 git clone -b $branch ${BASE_DIR} $dir_name
14+ else
15+ # if it exists, just update it
16+ cd $dir_name
17+ git fetch origin
18+ git rebase origin/$branch
19+ # rebase fails with conflict, delete and start over
20+ if [ " $? " != 0 ]; then
21+ cd ..
22+ rm -rf $branch
23+ git clone -b $branch ${BASE_DIR} $dir_name
24+ else
25+ cd ..
26+ fi
1427 fi
1528 cd $dir_name
1629 meson setup --warnlevel 0 --buildtype plain builddir
@@ -25,10 +38,10 @@ if [ ! -d google-benchmark ]; then
2538 git clone https://github.com/google/benchmark google-benchmark
2639fi
2740compare=$( realpath google-benchmark/tools/compare.py)
28- build_branch $br_commit
29- build_branch $main_commit
30- baseline=$( realpath ${main_commit } /builddir/benchexe)
31- contender=$( realpath ${br_commit} /builddir/benchexe)
41+ build_branch $branch
42+ build_branch " main "
43+ baseline=$( realpath ${branch } /builddir/benchexe)
44+ contender=$( realpath main /builddir/benchexe)
3245
3346if [ -z " $1 " ]; then
3447 echo " Comparing all benchmarks .."
0 commit comments