From 7b6372d7ffa737ab1049faf141eb1d1b86880f3b Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 18 Mar 2019 22:23:25 -0400 Subject: scripts/announce-release.sh: Truuncate long shortlog and diffstat --- (limited to 'scripts') diff --git a/scripts/announce-release.sh b/scripts/announce-release.sh index 4bb02b9..33fba1c 100755 --- a/scripts/announce-release.sh +++ b/scripts/announce-release.sh @@ -51,6 +51,32 @@ old_tag="$(git tag --sort=creatordate | tail -n 2 | head -n 1)" export GIT_DIR="${srcdir}/.git" +shortlog="$(git shortlog "${old_tag}..HEAD" | \ + sed '/^..*$/s/^//')" +if [ $(printf '%s\n' "${shortlog}" | wc -l) -gt 100 ]; then + shortlog="$(git shortlog -s "${old_tag}..HEAD"; cat <<-EOF + + Commit descriptions suppressed for brevity. To see a log + summary with descriptions, run: + + \$ git shortlog ${old_tag}..${package}/${version} + EOF + )" +fi +diffstat="$(git diff --stat=72 --color=never --find-renames=50% \ + "${old_tag}..HEAD")" +if [ $(printf '%s\n' "${diffstat}" | wc -l) -gt 50 ]; then + diffstat="$(printf '%s\n' "${diffstat}" | tail -n 1; cat <<-EOF + + Difference statistics truncated for brevity. To see full + statistics, run: + + \$ git diff --stat --find-renames=50% \ + > ${old_tag}..${package}/${version} + EOF + )" +fi + message="$({ cat | sed 's/=/=3D/g; s/ $/=20/; s/\t$/=09/;'; } <<-EOF Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable @@ -87,13 +113,11 @@ message="$({ cat | sed 's/=/=3D/g; s/ $/=20/; s/\t$/=09/;'; } <<-EOF $(heading "Shortlog of Changes Since Version ${old_version}") - $(git shortlog "${old_tag}..HEAD" | \ - sed '/^..*$/s/^/ /') + ${shortlog} $(heading "Diffstat of Changes Since Version ${old_version}") - $(git diff --stat=69 --color=never --find-renames=50% \ - "${old_tag}..HEAD" | sed 's/^/ /') + ${diffstat} -- ${SIG} -- cgit v0.9.1