From 3172a5063b02a4fa259b61bda30392ef8e527bcb Mon Sep 17 00:00:00 2001 From: "Dr. David von Oheimb" Date: Thu, 10 Oct 2024 22:13:42 +0200 Subject: [PATCH] check-format-commit.sh: make awk patterns more robust for MacOS and certain flavors of Linux --- util/check-format-commit.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/util/check-format-commit.sh b/util/check-format-commit.sh index cf958923fa0d76..d80fb19a0401d4 100755 --- a/util/check-format-commit.sh +++ b/util/check-format-commit.sh @@ -72,14 +72,14 @@ fi touch $TEMPDIR/ranges.txt git diff -U0 $COMMIT_RANGE | awk ' BEGIN {myfile=""} - /+{3}/ { - gsub(/b\//,"",$2); + /^\+\+\+/ { + sub(/^b./,"",$2); myfile=$2 } - /@@/ { - gsub(/+/,"",$3); + /^@@/ { + sub(/^\+/,"",$3); printf myfile " " $3 "\n" - }' >> $TEMPDIR/ranges.txt || true + }' > $TEMPDIR/ranges.txt || true # filter in anything that matches on a filter regex for i in ${FILE_ALLOWLIST[@]}