diff options
author | Thorvald Natvig <slicer@users.sourceforge.net> | 2009-03-21 23:36:54 +0300 |
---|---|---|
committer | Thorvald Natvig <slicer@users.sourceforge.net> | 2009-03-21 23:37:00 +0300 |
commit | 4eb6d7d90f8f8754439617f12f42c7cd66b8da5c (patch) | |
tree | b22e131d0364e5e77b28c7020d2b1aec5cf63ed5 /scripts/git2cl.pl | |
parent | 4ebaedd38985157744b69e119c1f083e634cbf6d (diff) |
New changelog script
Diffstat (limited to 'scripts/git2cl.pl')
-rw-r--r-- | scripts/git2cl.pl | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/scripts/git2cl.pl b/scripts/git2cl.pl new file mode 100644 index 000000000..1c009da4e --- /dev/null +++ b/scripts/git2cl.pl @@ -0,0 +1,46 @@ +#! /usr/bin/perl -w + +use warnings; +use strict; +use XML::Simple; +use Data::Dumper; +use Date::Parse; +use Text::Wrap qw(wrap fill); + +open(LOG, "git log origin/master --date=short --pretty=format:'%h%x00%an%x00%ae%x00%ad%x00%s'|"); +my %dates; +my %authors; +my $lsub = ''; +while(<LOG>) { + chomp(); + my ($hash,$author,$email,$date,$subject) = split(/\0/,$_); + if (! exists($authors{$email})) { + $authors{$email}=$author; + } + next if ($subject =~ /^Merge branch 'master/); + next if ($subject =~ /^Indent and submodule update/); + next if ($subject =~ /^Indent run/); + next if ($subject eq $lsub); + $lsub = $subject; + my $entry = wrap(" $hash ", " ", $subject); + if (! exists($dates{$date})) { + $dates{$date} = {}; + } + if (! exists($dates{$date}{$email})) { + $dates{$date}{$email} = (); + } + push @{$dates{$date}{$email}},$entry; +} +close(LOG); +open(C, ">CHANGES"); +foreach my $date (reverse sort keys %dates) { + print C $date."\n"; + my $h = $dates{$date}; + my $first = 1; + foreach my $author (sort keys %$h) { + print C " ".$authors{$author}." <$author>\n"; + print C join("\n", @{$dates{$date}{$author}}); + print C "\n\n"; + } +} +close(C); |