]> git.sesse.net Git - stockfish/commitdiff
Revise extract bench from git log in CI
authorJoost VandeVondele <Joost.VandeVondele@gmail.com>
Thu, 6 Jul 2023 16:30:51 +0000 (18:30 +0200)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Thu, 6 Jul 2023 21:01:27 +0000 (23:01 +0200)
order commits differently

closes https://github.com/official-stockfish/Stockfish/pull/4668

No functional change

.github/workflows/stockfish_test.yml

index b53d7e275d0534b860cc043c6917157f2a53688c..05592dae530adcbbf7a676470cd27cedefca5929 100644 (file)
@@ -119,8 +119,8 @@ jobs:
 
       - name: Extract the bench number from the commit history
         run: |
 
       - name: Extract the bench number from the commit history
         run: |
-          for ((n=0; n<100; n++)); do
-            benchref=$(git log HEAD~$n -1 | tac | grep -m 1 -o -x '[[:space:]]*\b[Bb]ench[ :]\+[1-9][0-9]\{5,7\}\b[[:space:]]*' | sed 's/[^0-9]//g') && break || true
+          for hash in $(git rev-list -100 HEAD); do
+            benchref=$(git show -s $hash | tac | grep -m 1 -o -x '[[:space:]]*\b[Bb]ench[ :]\+[1-9][0-9]\{5,7\}\b[[:space:]]*' | sed 's/[^0-9]//g') && break || true
           done
           [[ -n "$benchref" ]] && echo "benchref=$benchref" >> $GITHUB_ENV && echo "From commit: $(git rev-parse HEAD~$n)" && echo "Reference bench: $benchref" || echo "No bench found"
 
           done
           [[ -n "$benchref" ]] && echo "benchref=$benchref" >> $GITHUB_ENV && echo "From commit: $(git rev-parse HEAD~$n)" && echo "Reference bench: $benchref" || echo "No bench found"