5 ./git2changelog.pl Release-3.0.1..Release-3.0.2
7 For bweb ReleaseNotes, use
8 FORBWEB=1 ./git2changelog.pl Release-3.0.1..Release-3.0.2
13 use POSIX q/strftime/;
20 my $refs = shift || '';
21 my $for_bweb = $ENV{FORBWEB}?1:0;
22 open(FP, "git log --no-merges --pretty=format:'%at: %s' $refs|") or die "Can't run git log $!";
23 while (my $l = <FP>) {
25 # remove non useful messages
26 next if ($l =~ /(tweak|typo|cleanup|regress:|again|.gitignore|fix compilation|technotes)/ixs);
27 next if ($l =~ /update (version|technotes|kernstodo|projects|releasenotes|version|home|release|todo|notes|changelog|tpl|configure)/i);
29 next if ($l =~ /bacula-web:/);
32 next if ($l !~ /bweb/ixs);
35 next if ($l =~ /bweb:/ixs);
38 # keep list of fixed bugs
43 # remove old commit format
44 $l =~ s/^(\d+): (kes|ebl) /$1: /;
46 if ($l =~ /(\d+): (.+)/) {
48 my $dnow = strftime('%d%b%y', localtime($1));
49 my $cur = strftime('%Y%m%d', localtime($1));
52 # avoid identical multiple commit message
53 next if ($last_txt eq $txt);
56 # We format the string on 79 caracters
58 $txt =~ s/.{70,77} /$&\n /g;
60 # if we are the same day, just add entry
63 if (!exists $elt{$cur}) {
64 push @{$elt{$cur}}, "\n\n$dnow";
67 push @{$elt{$cur}}, " - $txt";
70 print STDERR "invalid format: $l\n";
76 foreach my $d (sort {$b <=> $a} keys %elt) {
77 print join("\n", @{$elt{$d}});
80 print "\n\nBug fixes\n";
81 print join(" ", sort keys %bugs), "\n";