From bca6137248b8b3dfa7569635bdd8df78c85ec230 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Mon, 31 Jul 2017 13:33:44 -0400 Subject: debian/new-upstream-snapshot: wrap changelog lines better. This just steamlines use of new-upstream-snapshot. It will now ignore Author of 'Scott Moser' and wrap long lines so that author entry in [] is not broken. --- debian/new-upstream-snapshot | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/debian/new-upstream-snapshot b/debian/new-upstream-snapshot index 6240de0d..aee432e3 100755 --- a/debian/new-upstream-snapshot +++ b/debian/new-upstream-snapshot @@ -14,9 +14,27 @@ EOF } print_commit() { - local subject="$1" author="$2" bugs="$3" aname="" + local subject="$1" author="$2" bugs="$3" aname="" buf="" abugs="" + local indent=" - " indent2=" " ll=79 aname=${author% <*} - echo " - $subject [${aname}]${bugs:+ (LP: ${bugs})}" + [ "${aname}" = "Scott Moser" ] && aname="" + abugs="${aname:+ [${aname}]}${bugs:+ (LP: ${bugs})}" + if [ $((${#subject}+${#abugs})) -le $(($ll-${#indent})) ]; then + echo "${indent}${subject}" + elif [ ${#subject} -ge $(($ll-${#indent})) ]; then + echo "${subject}${abugs}" | + fmt --width=$(($ll-${#indent})) | + sed -e "1s/^/${indent}/; 1n;" \ + -e 's/^[ ]*//' \ + -e '/^[ ]*$/d' -e "s/^/$indent2/" -e 's/[ ]\+$//' + + else + ( echo "${subject}"; echo "${abugs}" ) | + fmt --width=$(($ll-${#indent})) | + sed -e "1s/^/${indent}/; 1n;" \ + -e 's/^[ ]*//' \ + -e '/^[ ]*$/d' -e "s/^/$indent2/" -e 's/[ ]\+$//' + fi } git_log_to_dch() { -- cgit v1.2.3