From e139aa214bad86d9abf63f4ef5b10c2660a469d5 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Mon, 10 Jun 2024 12:33:29 -0400 Subject: [PATCH] List branches and print hash on error --- .github/workflows/check-i18n.yml | 2 +- scripts/check-i18n.sh | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check-i18n.yml b/.github/workflows/check-i18n.yml index 6595288da458..f739591e8c29 100644 --- a/.github/workflows/check-i18n.yml +++ b/.github/workflows/check-i18n.yml @@ -18,7 +18,7 @@ jobs: fetch-depth: 0 # all # Only check for missing hashes in new files - name: Any files missing hash key? - run: scripts/check-i18n.sh -n -x + run: scripts/check-i18n.sh -n -x -v - name: Any files with invalid hash keys? run: scripts/check-i18n.sh - run: .github/workflows/scripts/check-i18n-helper.sh diff --git a/scripts/check-i18n.sh b/scripts/check-i18n.sh index 53bc7fa842ee..8dc30e1f6de9 100755 --- a/scripts/check-i18n.sh +++ b/scripts/check-i18n.sh @@ -122,6 +122,13 @@ function process_CLI_args() { TARGET_PATHS="$DEFAULT_TARGET" # [[ -n $FLAG_VERBOSE ]] || echo "INFO: using default target path: $TARGET_PATHS" fi + + if [[ -n $FLAG_VERBOSE ]]; then + echo "INFO: local branches" + git branch -vv + echo + fi + if [[ -z $FLAG_QUIET ]]; then echo "Processing paths: $TARGET_PATHS" fi @@ -223,9 +230,6 @@ function main() { # if [[ -n $FLAG_VERBOSE ]]; then echo -e "All targets: $TARGETS"; fi fi - # set -x - # git branch -vv - local LASTCOMMIT_FF="" # commit From File (FF), i.e., $f in the loop below local LASTCOMMIT_GIT="" # last commit of `en` version of $f from git local FILE_COUNT=0 # Number of TLP @@ -276,7 +280,7 @@ function main() { ((FILE_PROCESSED_COUNT++)) EXIT_STATUS=$DIFF_STATUS # if [[ -z $FLAG_QUIET ]]; then - echo -e "HASH\tERROR\t$f: invalid hash or 'git diff' error (status: $DIFF_STATUS). For details, use -v." + echo -e "HASH\tERROR\t$f: git diff error ($DIFF_STATUS) or invalid hash $LASTCOMMIT. For details, use -v." # fi if [[ -n $FLAG_VERBOSE ]]; then echo "$DIFF"; fi continue