Re: [PATCH/WIP] git-svn: tweak log format to match "svn log" output
- From
- Eric Wong <normalperson@yhbt.net>
- Date
- Jul 25, 2010, 08:40 UTC
- Message-ID
- <20100725084057.GA23621@dcvr.yhbt.net>
- In-Reply-To
- <20100725083708.GB22213@burratino>
Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 37 quoted lines
> 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 > 0Thanks Jonathan, that looks much better. I'll squash that on top Jens' first patch.
-- Eric Wong