3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 ./git2changelog.pl Release-3.0.1..Release-3.0.2
10 For bweb ReleaseNotes, use
11 FORBWEB=1 ./git2changelog.pl Release-3.0.1..Release-3.0.2
16 use POSIX q/strftime/;
23 my $refs = shift || '';
24 my $for_bweb = $ENV{FORBWEB}?1:0;
25 open(FP, "git log --no-merges --pretty=format:'%at: %s' $refs|") or die "Can't run git log $!";
26 while (my $l = <FP>) {
28 # remove non useful messages
29 next if ($l =~ /(tweak|typo|cleanup|regress:|again|.gitignore|fix compilation|technotes)/ixs);
30 next if ($l =~ /update (version|technotes|kernstodo|projects|releasenotes|version|home|release|todo|notes|changelog|tpl|configure)/i);
32 next if ($l =~ /bacula-web:/);
35 next if ($l !~ /bweb/ixs);
38 next if ($l =~ /bweb:/ixs);
41 # keep list of fixed bugs
46 # remove old commit format
47 $l =~ s/^(\d+): (kes|ebl) /$1: /;
49 if ($l =~ /(\d+): (.+)/) {
51 my $dnow = strftime('%d%b%y', localtime($1));
52 my $cur = strftime('%Y%m%d', localtime($1));
55 # avoid identical multiple commit message
56 next if ($last_txt eq $txt);
59 # We format the string on 79 caracters
61 $txt =~ s/.{70,77} /$&\n /g;
63 # if we are the same day, just add entry
66 if (!exists $elt{$cur}) {
67 push @{$elt{$cur}}, "\n\n$dnow";
70 push @{$elt{$cur}}, " - $txt";
73 print STDERR "invalid format: $l\n";
79 foreach my $d (sort {$b <=> $a} keys %elt) {
80 print join("\n", @{$elt{$d}});
83 print "\n\nBugs fixed/closed since last release:\n";
84 print join(" ", sort keys %bugs), "\n";