From abdb557d8339ad94e91cfdafff520500077b1d0a Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Thu, 24 Jan 2019 08:12:20 +1100 Subject: [PATCH] check_fixes: minor cleanups The printf version of the messages didn't improve things --- check_fixes | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/check_fixes b/check_fixes index 954ad55..0bd89e6 100755 --- a/check_fixes +++ b/check_fixes @@ -15,6 +15,7 @@ Linus_tree="${HOME}/kernels/linus.git" split_re='^([[:xdigit:]]+)[[:space:]]+(.*)$' nl=$'\n' +# Strip the leading and training spaces from a string strip_spaces() { [[ "$1" =~ ^[[:space:]]*(.*[^[:space:]])[[:space:]]*$ ]] @@ -24,14 +25,24 @@ strip_spaces() for c in $commits; do commit_log=$(git log -1 --format='%h ("%s")' "$c") - commit_msg=$(printf 'In commit\n\n %s\n\n' "$commit_log") + commit_msg="In commit + + $commit_log + +" fixes_lines=$(git log -1 --format='%B' "$c" | grep -i '^[[:space:]]*Fixes:') while read -r fline; do f=$(echo "$fline" | sed 's/^[[:space:]]*Fixes:[[:space:]]*//i') - fixes_msg=$(printf 'Fixes tag\n\n %s\n\n has these problem(s):\n\n' "$fline") + fixes_msg="Fixes tag + + $fline + +has these problem(s): + +" sha= subject= msg= @@ -62,7 +73,7 @@ for c in $commits; do fi # strip matching quotes at the start and end of the subject - # the second characters in the classes are + # the unicode characters in the classes are # U+201C LEFT DOUBLE QUOTATION MARK # U+201D RIGHT DOUBLE QUOTATION MARK # U+2018 LEFT SINGLE QUOTATION MARK -- 2.39.5