summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-03-18 22:23:25 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-03-18 22:23:25 (EDT)
commit7b6372d7ffa737ab1049faf141eb1d1b86880f3b (patch)
tree4c1167489e56d94211502e046b0a12b76f9fe70d /scripts
parentd9ae96f487d8a36e121952e0ea3af7542aec72de (diff)
scripts/announce-release.sh: Truuncate long shortlog and diffstat
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/announce-release.sh32
1 files changed, 28 insertions, 4 deletions
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}