From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 26 Mar 2003 16:10:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 26 Mar 2003 16:10:22 -0500 Received: from krusty.dt.E-Technik.Uni-Dortmund.DE ([129.217.163.1]:41988 "EHLO mail.dt.e-technik.uni-dortmund.de") by vger.kernel.org with ESMTP id convert rfc822-to-8bit; Wed, 26 Mar 2003 16:10:12 -0500 MIME-Version: 1.0 To: torvalds@transmeta.com Subject: BK-kernel-tools/shortlog update Cc: linux-kernel@vger.kernel.org, matthias.andree@gmx.de, samel@mail.cz From: Matthias Andree Content-ID: Content-Type: text/plain; charset=US-ASCII Content-Description: An object packed by metasend Content-Transfer-Encoding: 7BIT Message-Id: <20030326212121.DB7C458C49@merlin.emma.line.org> Date: Wed, 26 Mar 2003 22:21:21 +0100 (CET) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Hello Linus, you can either use bk receive to patch this mail, you can pull from bk://krusty.dt.e-technik.uni-dortmund.de (NOTE: no trailing slash) or you can apply the patch below. Patch description: Update to upstream version 0.88: * Add regexp support for address -> name resolution. (0.86) * Add selftest mode to figure addresses that can be removed because they are also matched by regexps (0.88). Matthias ##### DIFFSTAT ##### # shortlog | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--------- # 1 files changed, 66 insertions(+), 11 deletions(-) ##### GNUPATCH ##### # This is a BitKeeper generated patch for the following project: # Project Name: BK kernel tools # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.43 -> 1.44 # shortlog 1.19 -> 1.20 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/03/26 matthias.andree@gmx.de 1.44 # Update to upstream version 0.88: # * Add regexp support for address -> name resolution. (0.86) # * Add selftest mode to figure addresses that can be removed because they # are also matched by regexps (0.88). # -------------------------------------------- # diff -Nru a/shortlog b/shortlog --- a/shortlog Wed Mar 26 22:21:21 2003 +++ b/shortlog Wed Mar 26 22:21:21 2003 @@ -8,7 +8,7 @@ # Tomas Szepe # Vitezslav Samel # -# $Id: lk-changelog.pl,v 0.85 2003/03/26 08:22:11 vita Exp $ +# $Id: lk-changelog.pl,v 0.88 2003/03/26 21:12:23 emma Exp $ # ---------------------------------------------------------------------- # Distribution of this script is permitted under the terms of the # GNU General Public License (GNU GPL) v2. @@ -53,6 +53,8 @@ use Text::Tabs; use Text::Wrap; +sub selftest(); + # -------------------------------------------------------------------- # customize the following line to change the indentation of the change # lines, $indent1 is used for the first line of an entry, $indent for @@ -63,6 +65,11 @@ my $debug = 0; # -------------------------------------------------------------------- +# Perl syntax magic here, "=>" is equivalent to "," +my @addrregexps = ( +[ 'alan@.*\.swansea\.linux\.org\.uk' => 'Alan Cox', ], +[ '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' => '~~~~~~~~' ]); + # the key is the email address in ALL LOWER CAPS! # the value is the real name of the person # @@ -101,8 +108,6 @@ 'akpm@digeo.com' => 'Andrew Morton', 'akpm@zip.com.au' => 'Andrew Morton', 'akropel1@rochester.rr.com' => 'Adam Kropelin', # lbdb -'alan@hraefn.swansea.linux.org.uk' => 'Alan Cox', -'alan@irongate.swansea.linux.org.uk' => 'Alan Cox', 'alan@lxorguk.ukuu.org.uk' => 'Alan Cox', 'alan@redhat.com' => 'Alan Cox', 'alex@ssi.bg' => 'Alexander Atanasov', @@ -889,12 +894,27 @@ my %address_unknown; -# get name associated to an email address -sub rmap_address { - my @o = map {defined $addresses{$_} ? $addresses{$_} : - scalar (($address_unknown{$_} = 1), $_); } - map { lc; } @_; - return wantarray ? @o : $o[0]; +# get name associated with an "email address" formatted +# BK_USER,BK_HOST tuple +sub rmap_address($) { + my $in = shift; + my $key = lc $in; + # try hash lookup first, return result if any + if (defined $addresses{$key}) { + return $addresses{$key}; + } + # try matching against all regexps in listed order + # return result if any + foreach my $ar (@addrregexps) { + if ($in =~ m/$ar->[0]/) { + return $ar->[1]; + } + } + # when the address is unknown, return the unchanged input + # and mark the address as unknown (so it can be printed in --warn + # mode). + $address_unknown{$key} = 1; + return $in; } # case insensitive string comparison @@ -1274,12 +1294,26 @@ return print $opt{width} ? expand(wrap("", "", ($a))) : $a, "\n"; } +sub selftest() { + my $rc = 0; + foreach my $address (keys %addresses) { + foreach my $ar (@addrregexps) { + if ($address =~ m/$ar->[0]/) { + print STDERR "Warning: address '$address'\n"; + print STDERR " shadows regexp '$ar->[0]'\n"; + $rc = 1; + } + } + } + return $rc; +} + # === MAIN PROGRAM =============================================== # Command line arguments # What options do we support? my @opts = ("help|?|h", "man", "mode=s", "compress!", "count!", "width:i", "swap!", "merge!", "warn!", "multi!", "abbreviate-names!", - "by-surname!"); + "by-surname!", "selftest"); # "bitkeeper|bk!"); # How do we parse them? @@ -1311,7 +1345,8 @@ unless defined $table{$opt{mode}}; pod2usage(-verbose => 0, -message => "$0: No files given, refusing to read from a TTY.") - if (not $opt{bitkeeper} and (@ARGV == 0) and (-t STDIN)); + if (not $opt{selftest} and not $opt{bitkeeper} + and (@ARGV == 0) and (-t STDIN)); pod2usage(-verbose => 0, -message => "$0: Must have one or two arguments in --bitkeeper mode.") if ($opt{bitkeeper} && (@ARGV < 1 || @ARGV > 2)); @@ -1358,6 +1393,10 @@ foreach (@ARGV) { print STDERR "DEBUG: '$_'\n"; } } +if ($opt{selftest}) { + exit selftest; +} + # Main program my @prolog; my %log; @@ -1406,6 +1445,18 @@ __END__ # -------------------------------------------------------------------- # $Log: lk-changelog.pl,v $ +# Revision 0.88 2003/03/26 21:12:23 emma +# Add selftest mode check: +# * check all addresses against all regexps to find addresses shadowing +# regular expressions. +# +# Revision 0.87 2003/03/26 21:02:53 emma +# Fix broken regexp for Alan's swansea.linux.org.uk addresses. Add some comments. +# +# Revision 0.86 2003/03/26 20:57:49 emma +# Support regexp queries (but try hash lookups first for efficiency). +# Requested by Linus Torvalds. +# # Revision 0.85 2003/03/26 08:22:11 vita # Added 6 names for new addresses. # @@ -1737,6 +1788,8 @@ --width[=WIDTH] specify the line length, if omitted: $COLUMNS or 80. text lines will not exceed this length. + --selftest perform some self tests (for developers of this script) + Warning: Neither --compress nor --count are currently functional with --mode=full. @@ -1825,6 +1878,8 @@ =head1 TODO =over + +=item * OBFUSCATE ADDRESSES (requested by Solar Designer) =item * --compress-me-harder ##### BKPATCH ##### This BitKeeper patch contains the following changesets: 1.44 ## Wrapped with gzip_uu ## begin 600 bkpatch306 M'XL(`-$9@CX``^U7VW+:2!!]1E_1B[T%)):L$8B;"Y7`G&^Y6(2CD/J+!H M['/&C#UXEPC9K\RBI>6KQW&2X..AR`0[7#`>L_#P[#U^S/S!E$D2"@,%/U'I MS>&.<=&O$*M9KLA5ROJ5\<7;JP^G8\,8#.!\3N,9FS`)@X$A$WY'0U^ M94%L24YC$3%)+2^)UJ7LVK%M!_^(T[3;;F_M]-JNNV8.AMI]MAGF,\ MB>8@?IPV.TR>]?JOYVB9]VX:7 MC<)K`J9MG,%_',*YX<%5ZE/)T#)DJ9"15W#J^\#9C"U3 M$%F:)ES"-.%`?712"#"/(:810Q&1A)E$70OJJ-UNE-J"A5/)A(0H\?5ITV"6 M<5:88`+DG$KP:`RWRE"4W#$?;SV*=,`]MD)3`%2IA")10'ES);':.";TB=V& M9;P'U\70C4_;]!OFW[P,PZ:V<;P%?)Y$[`G:8HXXA,DL!]LE7;O3ZI#NNDDZ M/7<]93TZ]3IVC]K,I[?^=U*[8T73Q2&DUW+63K?=;&L2%Q(['/[7_GR/O\_\ M4?0EO77+Z:$_BKZ._8R^S@_HVVZ#2I%;TB=.WVD"BR(*%PC=OC%R M77`,D=V6>-0;1\:U,6J[X*I&S'@(8A5+NL0(9X$'<\;9`50'QU4(!+`O68`$ M8+%4$%8/JD:T@A.%80'"`.K&[U"C(8U/K%?7EKA'@C!Z;85!G"VOK83/KJUL M48/!,=1.40K.DV7M`&X.E-JW/[MRG>W3C79]2.P6QC3L]AQH&Z-N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