# ====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ====================================================================
# a script to munge the output of 'svn log' into something approaching the
# style of a GNU ChangeLog.
#
# to use this, just fill in the 'hackers' hash with the usernames and
# name/emails of the people who work on your project, go to the top level
# of your working copy, and run:
#
# $ svn log | /path/to/gnuify-changelog.pl > ChangeLog
require 5.0;
use strict;
my %hackers = (
"svn" => 'Collab.net Subversion Team',
"jimb" => 'Jim Blandy <[email protected]>',
"sussman" => 'Ben Collins-Sussman <[email protected]>',
"kfogel" => 'Karl Fogel <[email protected]>',
"gstein" => 'Greg Stein <[email protected]>',
"brane" => 'Branko Cibej <[email protected]>',
"joe" => 'Joe Orton <[email protected]>',
"ghudson" => 'Greg Hudson <[email protected]>',
"lefty" => 'Lee P. W. Burgess <[email protected]>',
"fitz" => 'Brian Fitzpatrick <[email protected]>',
"mab" => 'Matthew Braithwaite <[email protected]>',
"daniel" => 'Daniel Stenberg <[email protected]>',
"mmurphy" => 'Mark Murphy <[email protected]>',
"cmpilato" => 'C. Michael Pilato <[email protected]>',
"kevin" => 'Kevin Pilch-Bisson <[email protected]>',
"philip" => 'Philip Martin <[email protected]>',
"jerenkrantz" => 'Justin Erenkrantz <[email protected]>',
"rooneg" => 'Garrett Rooney <[email protected]>',
"bcollins" => 'Ben Collins <[email protected]>',
"blair" => 'Blair Zajac <[email protected]>',
"striker" => 'Sander Striker <[email protected]>',
"XelaRellum" => 'Alexander Mueller <[email protected]>',
"yoshiki" => 'Yoshiki Hayashi <[email protected]>',
"david" => 'David Summers <[email protected]>',
"rassilon" => 'Bill Tutt <[email protected]>',
"kbohling" => 'Kirby C. Bohling <[email protected]>',
"breser" => 'Ben Reser <[email protected]>',
"bliss" => 'Tobias Ringstrom <[email protected]>',
"dionisos" => 'Erik Huelsmann <[email protected]>',
"josander" => 'Jostein Andersen <[email protected]>',
"julianfoad" => 'Julian Foad <[email protected]>',
"clkao" => 'Chia-Liang Kao <[email protected]>',
"xsteve" => 'Stefan Reichör <[email protected]>',
"mbk" => 'Mark Benedetto King <[email protected]>',
"patrick" => 'Patrick Mayweg <[email protected]>',
"jrepenning" => 'Jack Repenning <[email protected]>',
"epg" => 'Eric Gillespie <[email protected]>',
"dwhedon" => 'David Kimdon <[email protected]>',
"djh" => 'D.J. Heap <[email protected]>',
"mprice" => 'Michael Price <[email protected]>',
"jszakmeister" => 'John Szakmeister <[email protected]>',
"bdenny" => 'Brian Denny <[email protected]>',
"rey4" => 'Russell Yanofsky <[email protected]>',
"maxb" => 'Max Bowsher <[email protected]>',
"dlr" => 'Daniel Rall <[email protected]>',
"jaa" => 'Jani Averbach <[email protected]>',
"pll" => 'Paul Lussier <[email protected]>',
"shlomif" => 'Shlomi Fish <[email protected]>',
"jpieper" => 'Josh Pieper <[email protected]>',
"dimentiy" => 'Dmitriy O. Popkov <[email protected]>',
"kellin" => 'Shamim Islam <[email protected]>',
"sergeyli" => 'Sergey A. Lipnevich <[email protected]>',
"kraai" => 'Matt Kraai <[email protected]>',
"ballbach" => 'Michael Ballbach <[email protected]>',
"kon" => 'Kalle Olavi Niemitalo <[email protected]>',
"knacke" => 'Kai Nacke <[email protected]>',
"gthompson" => 'Glenn A. Thompson <[email protected]>',
"jespersm" => 'Jesper Steen Møller <[email protected]>',
"naked" => 'Nuutti Kotivuori <[email protected]>',
"niemeyer" => 'Gustavo Niemeyer <[email protected]>',
"trow" => 'Jon Trowbridge <[email protected]>',
"mmacek" => 'Marko Macek <[email protected]>',
"zbrown" => 'Zack Brown <[email protected]>',
"morten" => 'Morten Ludvigsen <[email protected]>',
"fmatias" => 'Féliciano Matias <[email protected]>',
"nsd" => 'Nick Duffek <[email protected]>',
);
my $parse_next_line = 0;
my $last_line_empty = 0;
my $last_rev = "";
while (my $entry = <>) {
# Axe windows style line endings, since we should try to be consistent, and
# the repos has both styles in its log entries
$entry =~ s/\r\n$/\n/;
# Remove trailing whitespace
$entry =~ s/\s+$/\n/;
my $this_line_empty = $entry eq "\n";
# Avoid duplicate empty lines
next if $this_line_empty and $last_line_empty;
# Don't fail on valid dash-only lines
if ($entry =~ /^-+$/ and length($entry) >= 72) {
# We're at the start of a log entry, so we need to parse the next line
$parse_next_line = 1;
# Check to see if the final line of the commit message was blank,
# if not insert one
print "\n" if $last_rev ne "" and !$last_line_empty;
} elsif ($parse_next_line) {
# Transform from svn style to GNU style
$parse_next_line = 0;
my @parts = split (/ /, $entry);
$last_rev = $parts[0];
my $hacker = $parts[2];
my $tstamp = $parts[4];
# Use alias if we can't resolve to name, email
$hacker = $hackers{$hacker} if defined $hackers{$hacker};
printf "%s %s\n", $tstamp, $hacker;
} elsif ($this_line_empty) {
print "\n";
} else {
print "\t$entry";
}
$last_line_empty = $this_line_empty;
}
# As a HERE doc so it also sets the final changelog's coding
print <<LOCAL;
;; Local Variables:
;; coding: utf-8
;; End:
LOCAL
1;