From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S266762AbUGLJGW (ORCPT ); Mon, 12 Jul 2004 05:06:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S266765AbUGLJGW (ORCPT ); Mon, 12 Jul 2004 05:06:22 -0400 Received: from mail.dt.e-technik.Uni-Dortmund.DE ([129.217.163.1]:25279 "EHLO mail.dt.e-technik.uni-dortmund.de") by vger.kernel.org with ESMTP id S266762AbUGLJGL convert rfc822-to-8bit (ORCPT ); Mon, 12 Jul 2004 05:06:11 -0400 MIME-Version: 1.0 To: torvalds@osdl.org, marcelo.tosatti@cyclades.com.br 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: <20040712090607.DFCFAC3662@merlin.emma.line.org> Date: Mon, 12 Jul 2004 11:06:07 +0200 (CEST) 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 with this mail, or you can Pull from: bk://krusty.dt.e-technik.uni-dortmund.de/BK-kernel-tools or in cases of dire need, you can apply the patch below. BK: Parent repository is http://bktools.bkbits.net/bktools Patch description: ChangeSet@1.201, 2004-07-12 11:04:45+02:00, matthias.andree@gmx.de * Implement address precedence logic * If the LINUXKERNEL_BK_FMT_DEBUG environment variable is non-empty, enter debug mode. Matthias ------------------------------------------------------------------------ ##### DIFFSTAT ##### # shortlog | 105 ++++++++++++++++++++++++++++++------------- # 1 files changed, 74 insertions(+), 31 deletions(-) ##### GNUPATCH ##### # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/07/12 11:04:45+02:00 matthias.andree@gmx.de # * Implement address precedence logic # * If the LINUXKERNEL_BK_FMT_DEBUG environment variable is non-empty, enter debug mode. # # shortlog # 2004/07/12 11:04:44+02:00 matthias.andree@gmx.de +74 -31 # * Implement address precedence logic ($namepref), priority: # 2 (highest) - From: # 1 - Signed-off-by: (the first one found in a block) # 0 - BK information on ChangeSet author # * Consolidate From: and Signed-off-by: parsing into a common function, treat_address($$) # * Check LINUXKERNEL_BK_FMT_DEBUG environment variable, if nonzero, enter debug mode. # * Kill some trailing whitespace. # diff -Nru a/shortlog b/shortlog --- a/shortlog 2004-07-12 11:06:07 +02:00 +++ b/shortlog 2004-07-12 11:06:07 +02:00 @@ -8,7 +8,7 @@ # Tomas Szepe # Vitezslav Samel # -# $Id: lk-changelog.pl,v 0.307 2004/07/02 08:59:44 vita Exp $ +# $Id: lk-changelog.pl,v 0.309 2004/07/12 09:00:05 emma Exp $ # ---------------------------------------------------------------------- # Distribution of this script is permitted under the terms of the # GNU General Public License (GNU GPL) v2. @@ -68,6 +68,11 @@ my $debug = 0; # -------------------------------------------------------------------- +if (defined $ENV{LINUXKERNEL_BK_FMT_DEBUG} + and $ENV{LINUXKERNEL_BK_FMT_DEBUG}) { + $debug = 1; +} + # Perl syntax magic here, "=>" is equivalent to "," my @addrregexps = ( [ 'alan@[^.]+\.swansea\.linux\.org\.uk' => 'Alan Cox', ], @@ -2107,7 +2112,7 @@ # * $author can be the email address or Joe N. Sixpack II # (ready formatted to print) # * $name is the name (Joe N. Sixpack II) or the mail address -# () +# () sub get_name() { return $name; } sub get_author() { return $author; } @@ -2180,7 +2185,7 @@ croak "do not call removedups() in scalar context" unless wantarray; my @u = grep (!$t{lc $_}++, @_); return map { - $t{lc $_} > 1 ? sprintf("%d x ", $t{lc $_}) . $_ : $_; + $t{lc $_} > 1 ? sprintf("%d x ", $t{lc $_}) . $_ : $_; } @u; } @@ -2298,7 +2303,7 @@ compress(map { $_->[0]; } @{$log->{$_}})), "\n" or write_error(); } else { - print join("\n", map { "$indent1$_ ($a)" } + print join("\n", map { "$indent1$_ ($a)" } compress(map { $_->[0]; } @{$log->{$_}})), "\n" or write_error(); } @@ -2478,6 +2483,28 @@ return $author; } +# Treat address +# INPUT: Tuple of Name, Address scalars +# OUTPUT: Tuple of Name, Address, Author scalars in an array +sub treat_address($$) { + my $n = shift; + my $a = lc shift; + my $au; + my $tmp; + + if (($tmp = rmap_address($a, 0)) eq $a) { + if ($n =~ /\s+/) { + # not found, but only add if two words or more in name. + $address_found_in_from{$a} = sprintf "'%s' => '%s',", + obfuscate $a, $n; # FIXME: has this any effect? + } + } else { + $n = $tmp; + } + $au = treat_addr_name($a, $n); + return ($n, $a, $au); +} + # Read a file and parse it into the %log hash. sub parse_file(\%$$ ) { # arguments: %log hash @@ -2494,8 +2521,18 @@ my @cur = (); my $first = 0; my $firstpar = 0; + my $namepref = 0; # where address is from + # 0 - BK; 1 - Signed-off-by; 2 - From undef $address; + ############################################################### + # Linus' intended logic is: + # - preference is given to From: (namepref 2) + # - lacking From:, use the first Signed-off-by: we encounter + # (namepref 1) + # - lacking that information, use BK user info (namepref 0) + ############################################################### + # now go! # NOTE: the first @cur item can consist of multiple lines in the @@ -2531,41 +2568,30 @@ $address =~ s/\[[^]]+\]$//; $name = rmap_address($address, 1); $author = treat_addr_name($address, $name); - print STDERR "AUTHOR $author\n" if $debug; $first = 1; $firstpar = 1; + print STDERR " BK-CHANGESET $author\n" if $debug; + $namepref = 0; } elsif (/^\s+From:?\s*"?([^"]*)"?\s+\<(.*)\>\s*$/) { - my $tmp; - $name = $1; - $address = lc $2; - if (($tmp = rmap_address($address, 0)) eq $address) { - if ($name =~ /\s+/) { - # not found, but only add if two words or more in name. - $address_found_in_from{$address} = sprintf "'%s' => '%s',", - obfuscate $address, $name; - } + my @nameauthor = treat_address($1, $2); + if ($namepref < 2) { + ($name, $address, $author) = @nameauthor; + $namepref = 2; + print STDERR " FROM $author\n" if $debug; } else { - $name = $tmp; + print STDERR " SKIPPED FROM $author\n" if $debug; } - $author = treat_addr_name($address, $name); - print STDERR " FROM $author\n" if $debug; } elsif (/^\s+Signed-off-by:\s*"?([^"]*)"?\s+\<(.*)\>\s*$/i) { - my $tmp; - $name = $1; - $address = lc $2; - if (($tmp = rmap_address($address, 0)) eq $address) { - if ($name =~ /\s+/) { - # not found, but only add if two words or more in name. - $address_found_in_from{$address} = sprintf "'%s' => '%s',", - obfuscate $address, $name; - } + my @nameauthor = treat_address($1, $2); + if ($namepref < 1) { + ($name, $address, $author) = @nameauthor; + $namepref = 1; + print STDERR " SIGNED-OFF-BY $author\n" if $debug; } else { - $name = $tmp; + print STDERR " SKIPPED SIGNED-OFF-BY $author\n" if $debug; } - $author = treat_addr_name($address, $name); - print STDERR " SIGNED-OFF-BY $author\n" if $debug; } elsif ($first) { - # we have a "first" line after an address, take it, + # we have a "first" line after an address, take it, # strip common redundant tags # kill "PATCH" tag @@ -2599,7 +2625,7 @@ # store header before a changelog push @prolog, $_; } - } + } # while more lines in file if ($fh -> error) { die "Error while reading from \"$fn\": $!"; @@ -2862,6 +2888,18 @@ Summarizes or reformats BitKeeper ChangeLogs for Linux Kernel 2.X. +Addresses of patch authors are determined with the following precedence: + +=over + +=item 1. From: line + +=item 2. Signed-off-by + +=item 3. BK user/host + +=back + --mode options are: =over @@ -2900,6 +2938,11 @@ set in this variable on the command line. B If you put --swap here and --noswap on your command line, --noswap takes precedence. + +=item LINUXKERNEL_BK_FMT_DEBUG + +If this evaluates to "true" when used as Perl expression, i. e. it is a +nonempty string or a number other than 0, enable debugging. =back ##### BKPATCH ##### This BitKeeper patch contains the following changesets: 1.201 ## Wrapped with gzip_uu ## M'XL( ']4\D \57^V_;-A#^.?HK#HZ'V:OM4++DY])'&J]F]-5"##:.1N].W[\YB'DK$QD2^=<%IG0O!6J[.9.]L9CS,./Z[59)^C?>/U.$-P(3P1!Z+M\VNUU M1>@YC^)Y;>-X:,9G7==CO:#O>S=HS^L[N^"VT#0P?XMUMUP/7'? _($?O&#> M@#'XO%5XX4*3.3OPC6-XZX3P XRS12HR(37P"!Q].)KNCG=-W(.1YDBMI#)WS/.'35$!2@%2R M*;*%OF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