diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-07-07 08:44:48 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-07-07 08:44:48 +0200 |
commit | a11ee296f504a53c71aa04325ad2bb0dc955debc (patch) | |
tree | acb28f00fe3759dc37113f9849f2b8405f366fda | |
parent | ad12713afd54b9dae42e708f219f7c3953859b73 (diff) | |
download | org-mode-a11ee296f504a53c71aa04325ad2bb0dc955debc.tar.gz |
Add script to create ChangeLog for Emacs
-rwxr-xr-x | UTILITIES/make_emacs_changelog | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/UTILITIES/make_emacs_changelog b/UTILITIES/make_emacs_changelog new file mode 100755 index 0000000..0a9d995 --- /dev/null +++ b/UTILITIES/make_emacs_changelog @@ -0,0 +1,50 @@ +#!/usr/bin/perl + +$commitrange = shift @ARGV; +if (!$commitrange) { + print STDERR "Enter commitrange: "; + $commitrange = <>; + $commitrange =~ s/\s*(.*?)\s+/$1/; +} + +$syncdate = shift @ARGV; +if (!$syncdate) { + print STDERR "Enter syncdate YYYY-MM-DD: "; + $syncdate = <>; + $syncdate =~ s/\s*(.*?)\s+/$1/; +} + +# Run git log to get the commits the messages +open IN,"git log $commitrange|"; +undef $/; +$log = <IN>; +@commits = split(/^(?=commit)/m,$log); + +for $i (0..$#commits) { + $entry = 0; $tiny = 0; + $commit = $commits[$i]; + $author = $1 if $commit=~/^Author: ([^\n]+)/m; + $date = $1 if $commit=~/^Date: ([^\n]+)/m; + $entry = $1 if $commit=~/^([ \t]*\* [^\f]*?)(\n[ \t]*\n|\Z)/m; + $tiny = " (tiny change)" if $commit =~ /TINYCHANGE/; + + # split author into name and address + if ($author =~ /(.*?)\s+(<.*?>)/) { + $name = $1; + $address = $2; + } else { + warn "No name/address"; + next; + } + + if ($entry) { + # indent each line by 1 TAB + $entry =~ s/^[ \t]*/\t/gm; + # Add empty lines if there are several files in there + $entry =~ s/(\n[ \t]+\* )/\n$1/g; + # remove the lisp part of the path + $entry =~ s/^([ \t]+\* )lisp\//$1/mg; + print "$syncdate $name $address\n\n$entry\n\n"; + } +} + |