From 19e2a8850483c67835c0829ef016c6ede988817b Mon Sep 17 00:00:00 2001 From: Joost VandeVondele Date: Thu, 6 Jul 2023 18:30:51 +0200 Subject: [PATCH] Revise extract bench from git log in CI order commits differently closes https://github.com/official-stockfish/Stockfish/pull/4668 No functional change --- .github/workflows/stockfish_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stockfish_test.yml b/.github/workflows/stockfish_test.yml index b53d7e27..05592dae 100644 --- a/.github/workflows/stockfish_test.yml +++ b/.github/workflows/stockfish_test.yml @@ -119,8 +119,8 @@ jobs: - 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" -- 2.39.2