3
3
SCRIPT_DIR=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd )
4
4
BASE_DIR=$( dirname $SCRIPT_DIR )
5
5
branch=$( 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)
8
8
echo " Comparing main branch with $branch "
9
9
10
10
build_branch () {
11
11
dir_name=$1
12
12
if [ ! -d $dir_name ]; then
13
13
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
14
27
fi
15
28
cd $dir_name
16
29
meson setup --warnlevel 0 --buildtype plain builddir
@@ -25,10 +38,10 @@ if [ ! -d google-benchmark ]; then
25
38
git clone https://github.com/google/benchmark google-benchmark
26
39
fi
27
40
compare=$( 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)
32
45
33
46
if [ -z " $1 " ]; then
34
47
echo " Comparing all benchmarks .."
0 commit comments