3 $commitrange = shift @ARGV;
5 print STDERR
"Enter commitrange: ";
7 $commitrange =~ s/\s*(.*?)\s+/$1/;
10 $syncdate = shift @ARGV;
12 print STDERR
"Enter syncdate YYYY-MM-DD: ";
14 $syncdate =~ s/\s*(.*?)\s+/$1/;
17 # Run git log to get the commits the messages
18 open IN
,"git log $commitrange|";
21 @commits = split(/^(?=commit)/m,$log);
23 for $i (0..$#commits) {
24 $entry = ""; $tiny = "";
25 $commit = $commits[$i];
26 $author = $1 if $commit=~/^Author: ([^\n]+)/m;
27 $date = $1 if $commit=~/^Date: ([^\n]+)/m;
28 $entry = $1 if $commit=~/^([ \t]*\* [^\f]*?)(\n[ \t]*\n|\Z)/m;
29 $tiny = " (tiny change)" if $commit =~ /TINYCHANGE/;
31 # split author into name and address
32 if ($author =~ /(.*?)\s+(<.*?>)/) {
36 warn "No name/address";
41 # indent each line by 1 TAB
42 $entry =~ s/^[ \t]*/\t/gm;
43 # Add empty lines if there are several files in there
44 $entry =~ s/(\n[ \t]+\* )/\n$1/g;
45 # remove the lisp part of the path
46 $entry =~ s/^([ \t]+\* )lisp\//$1/mg
;
47 print "$syncdate $name $address$tiny\n\n$entry\n\n";