]> granicus.if.org Git - mutt/commitdiff
Update mkchangelog.sh to use git.
authorKevin McCarthy <kevin@8t8.us>
Fri, 15 Dec 2017 00:16:27 +0000 (16:16 -0800)
committerKevin McCarthy <kevin@8t8.us>
Fri, 15 Dec 2017 00:16:27 +0000 (16:16 -0800)
The output isn't quite as nice as the hg generated version, but is
close.

With Mercurial, and now Git, I'm not sure of the usefulness of
maintaining a ChangeLog file in the repos, but that is another
discussion.

hg-changelog-map [deleted file]
mkchangelog.sh

diff --git a/hg-changelog-map b/hg-changelog-map
deleted file mode 100644 (file)
index 27bdc7a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-header = '{date|isodate}  {author|person}  <{author|email}>  ({node|short})\n\n'
-changeset = '\t* {files|stringify|fill68|tabindent|strip}\n\n'
-file = '{file}, '
-last_file = '{file}: {desc}\n\t'
-no_files = '{desc}'
index 2b610da824145c5ac553f4fce6e9d180832a72dd..fc03a6f433f71cd6e2ecdca65267deb9a5c35e09 100755 (executable)
@@ -1,5 +1,17 @@
 #!/bin/sh
+#
+# Generates the ChangeLog since the last release.
 
-lrev=$(hg log --limit 1 --template '{rev}' ChangeLog)
+# This would generate based on the last update of the ChangeLog, instead:
+# lrev=$(git log -1 --pretty=format:"%H" ChangeLog)
 
-hg log --style=./hg-changelog-map -r "reverse($lrev::.)"
+lrev=$(git tag --merged=HEAD --list 'mutt-*-rel' | tr - . | sort -Vr | head -n1 | tr . -)
+
+# This is a rough approximation of the official ChangeLog format
+# previously generated by hg.  Git doesn't provide enough formatting
+# tools to produce this more accurately.  We could post-format it with
+# a script, but I'm not sure enough people care about this file
+# anymore to make it worth the effort.
+git log --name-status \
+    --pretty=format:"%ai  %an  <%ae> (%h)%n%n%w(,8,8)* %s%n%+b" \
+    ${lrev}^..