Skip to content

Commit b1f539e

Browse files
committed
Fix the autorun script to use hashes instead of tags
1 parent 182dd6d commit b1f539e

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

benchmark/utils/autorun_benchmarks.sh

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,13 @@ do
4040
esac
4141
done
4242

43-
# Check if the tags already exist and delete them if they do
44-
if git rev-parse -q --verify "refs/tags/after_debug" >/dev/null; then
45-
git tag -d after_debug
46-
fi
47-
48-
if git rev-parse -q --verify "refs/tags/before_debug" >/dev/null; then
49-
git tag -d before_debug
50-
fi
51-
52-
# Tag the last commit as 'after_debug'
53-
git tag after_debug HEAD
54-
echo "Tagged the latest commit as 'after_debug'"
43+
# Retrieve last two commit hashes
44+
before_debug=$(git rev-parse HEAD~1)
45+
after_debug=$(git rev-parse HEAD)
5546

56-
# Tag the second last commit as 'before_debug'
57-
git tag before_debug HEAD~1
58-
echo -e "Tagged the previous commit as 'before_debug'\n"
47+
# Tag the last two commits if they are not already tagged
48+
git tag -f after_debug $after_debug
49+
git tag -f before_debug $before_debug
5950

6051
# Print the before and after tags with their messages
6152
git tag -n | grep -E 'before_debug|after_debug' | while IFS= read -r line; do echo "$line"; done ; echo ""
@@ -64,12 +55,13 @@ git tag -n | grep -E 'before_debug|after_debug' | while IFS= read -r line; do ec
6455
if [ "$advection" == true ]; then
6556
# Set the benchmark script for advection
6657
benchmark_script="benchmark/benchmarks_advection.jl"
67-
command="benchpkg --rev=before_debug,after_debug \
58+
command="benchpkg --rev=$before_debug,$after_debug \
6859
-s $benchmark_script \
60+
--bench-on=$after_debug \
6961
--exeflags=\"--threads=$threads\""
7062
else
71-
command="benchpkg --rev=before_debug,after_debug \
72-
--bench-on=after_debug \
63+
command="benchpkg --rev=$before_debug,$after_debug \
64+
--bench-on=$after_debug \
7365
--exeflags=\"--threads=$threads\""
7466
fi
7567

0 commit comments

Comments
 (0)