Re: [PATCH/WIP] git-svn: tweak log format to match "svn log" output

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

 



Jonathan Nieder <jrnieder@xxxxxxxxx> wrote:
> Eric Wong wrote:
> 
> > @@ -5646,8 +5644,8 @@ sub show_commit_normal {
> >  
> >  	if ($can_localize) {
> >  		my $d = Locale::gettext->domain("subversion");
> > -		$sing_fmt = $d->nget(" | %d line", " | %d lines", 1);
> > -		$plur_fmt = $d->nget(" | %d line", " | %d lines", 10);
> > +		$sing_fmt = $d->nget($sing_fmt, $plur_fmt, 1);
> > +		$plur_fmt = $d->nget($sing_fmt, $plur_fmt, 10);
> 
> This change gives me pause: wouldn’t it be a problem in
> non-English locales, where $sing_fmt changes before it is
> used to set $plur_fmt?
> 
> Of course there is no problem because the code is equivalent to
> 
> 		$sing_fmt = $d->get($sing_fmt);
> 		$plur_fmt = $d->get($plur_fmt);
> 
> (or at least Locale::gettext is advertised to work that way.)
> 
> diff --git i/git-svn.perl w/git-svn.perl
> index 5252722..75e7165 100755
> --- i/git-svn.perl
> +++ w/git-svn.perl
> @@ -5644,8 +5644,8 @@ sub show_commit_normal {
>  
>  	if ($can_localize) {
>  		my $d = Locale::gettext->domain("subversion");
> -		$sing_fmt = $d->nget($sing_fmt, $plur_fmt, 1);
> -		$plur_fmt = $d->nget($sing_fmt, $plur_fmt, 10);
> +		$sing_fmt = $d->get($sing_fmt);
> +		$plur_fmt = $d->get($plur_fmt);
>  	}
>  	if (my $l = $c->{l}) {
>  		while ($l->[$#$l] eq "\n" && $#$l > 0

Thanks Jonathan, that looks much better.  I'll squash that on top
Jens' first patch.

-- 
Eric Wong
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]