savannah-hackers-public
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Savannah-hackers-public] Re: log_accum


From: Derek R. Price
Subject: [Savannah-hackers-public] Re: log_accum
Date: Fri, 17 Nov 2006 13:38:36 -0500
User-agent: Thunderbird 1.5.0.8 (Windows/20061025)

Sylvain Beucler wrote:
> Here are couple bugfixes in the options parsing. It prevented the
> (HEAD|TRUNK) -> "" substitution in --only-tag.

I've committed most of this.  Comments below.

> ------------------------------------------------------------------------
> 
> --- upstream/log_accum.pl     2006-08-19 07:43:51.000000000 +0000
> +++ log_accum.pl      2006-11-17 18:10:42.000000000 +0000
> @@ -199,7 +199,7 @@
>  
>      # Just set @debug in a global.  It's easier.
>      $config->{'debug-log'} = [] unless exists $config->{'debug-log'};
> -    push @{$config->{'debug-log'}}, '&STDERR' if $config->{debug};
> +    push @{$config->{'debug-log'}}, '&STDERR' if $config->{'debug'};
>      foreach (@{$config->{'debug-log'}})
>      {
>       my $debug;

This appears to be a noop.  I am not including it (hash keys matching
/[a-zA-Z0-9_]/ do not need to be quoted in Perl and I prefer to leave
out the unnecessary quotes).

> @@ -236,16 +236,16 @@
>      my %config;
>  
>      # Set up the option processing functions.
> -    $config{'only-tags'} =
> +    $config{'only-tag'} =

Okay.

>       sub
>       {
> -         $_[1] = '' if $_[1] eq "HEAD" || $_[1] eq "TRUNK";
> +         $_[1] = '' if $_[1] eq 'HEAD' || $_[1] eq 'TRUNK';

This is a noop, but I included it anyhow since I prefer single quotes
when variable substitution is not desired.

>           push @{$config{'tag'}}, $_[1];
>       };
>      $config{'quiet'} =
>       sub
>       {
> -         $config{'verbose'} = !$_[1];
> +         $config{'debug'} = !$_[1];

Fixed as specified.

>       };
>      $config{'file-prefix'} =
>       sub
> @@ -258,7 +258,7 @@
>       sub
>       {
>           warn "Using deprecated -u option. Use -T instead.";
> -         &{$config{'file-text'}} (@_);
> +         $config{'user'} = $_[1];

$config{'user'} was never used.  I replaced this with the following line
instead, as I believe was the original intention:

    &{$config{'file-prefix'}} (@_);

>       };
>      $config{'suppress-diffs-against-empties'} =
>       sub
> @@ -274,7 +274,7 @@
>  # This is global for convenience.  It is used in parse_config & process_argv.
>  my @option_spec = ("config|c=s@",
>                  "mail-to|m=s@",
> -                "tag|only-tag|r=s@",
> +                "only-tag|tag|r=s@",
>                  "file-prefix|file-text|T=s", "user|u=s",
>                  "debug|verbose|v!",
>                  "debug-log|debug-file=s@",

This is a noop too.  I don't see any good reason for reordering it, but
I included it anyhow.

Cheers,

Derek
-- 
Derek R. Price
CVS Solutions Architect
Get CVS support at Ximbiot <http://ximbiot.com>!
v: +1 248.835.1260
f: +1 248.835.1263
<mailto:address@hidden>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]