split_re='^([[:xdigit:]]+)[[:space:]]+(.*)$'
nl=$'\n'
+# Strip the leading and training spaces from a string
strip_spaces()
{
[[ "$1" =~ ^[[:space:]]*(.*[^[:space:]])[[:space:]]*$ ]]
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=
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