diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2019-03-24 11:32:37 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2019-03-24 11:32:37 -0400 |
commit | c61e411709e324b828e9a5cfefb265bdd6234c54 (patch) | |
tree | 22b71f58fffe09b77d59e725c001200a8a31c788 | |
parent | 0f30c7a9196c0296954d8a9d71495633c6d3da8a (diff) | |
download | virtio-spec-c61e411709e324b828e9a5cfefb265bdd6234c54.tar.gz |
editorial: gitlog.pl: generate the changelog
Incomplete: need to massage the changelog manually.
But it's a start.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | gitlog.pl | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gitlog.pl b/gitlog.pl new file mode 100644 index 0000000..dc6213d --- /dev/null +++ b/gitlog.pl @@ -0,0 +1,30 @@ +#!/usr/bin/perl + +use strict; + +my @hashes=split(' ', `git log --reverse -q --format=%h virtio-v1.1-csprd01..`); + +sub escapelatex { + my $s = shift; + $s =~ s/[\\]/\\textbackslash /go; + $s =~ s/([&#%{}\$])/\\$1/go; + $s =~ s/[~]/\\~{}/go; + $s =~ s/(https?:\S*)/\\url{$1}/go; +#1st line always on a separate paragraph + $s =~ s/\n/\n\n/o; +#Guess where new paragraph starts + $s =~ s/\\.\n/.\n\n/go; + $s =~ s/\n-/\n\n-/go; + return $s; +} + +for my $h (@hashes) { + my $date = `git show -q --format='%cd' --date='format:%d %b %Y' $h`; + chomp $date; + my $author = `git show -q --format='%aN' $h`; + chomp $author; + my $cl = `git show -q --format='%B' $h`; + $cl = escapelatex($cl); + print "$h & $date & $author & { $cl } \\\\\n"; + print "\\hline\n"; +} |