git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
JSJens Seidel <jensseidel@users.sf.net>
Date
Jul 25, 2010, 09:09 UTC
Message-ID
<20100725090943.GA1998@merkur.sol.de>
In-Reply-To
<20100725084057.GA23621@dcvr.yhbt.net>
On Sun, Jul 25, 2010 at 08:40:57AM +0000, Eric Wong wrote:
Show 19 quoted lines
> Jonathan Nieder <jrnieder@gmail.com> wrote:
> > 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.

No, this is still wrong, we have to use $d->nget as some languages can have multiple plural forms. Russian e.g. has two: one if the last digit ends with 2-4 and a second one if it ends with 5-9. Exact rule: "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"

That's why it's wrong to use $plur_fmt at all (and also "10" from above makes no sense). Let's use: $d->nget(" | %d line", " | %d lines", $nr_line), $nr_line) where $nr_line is the variable.

Sorry for not providing a patch now but I need more time ... I suggest one of you try it again and I check it :-)

Jens
Previous: Eric WongNext: Jens Seidel
Message 8 of 9 in “git-svn: tweak log format to match "svn log" output”
  1. git-svn: tweak log format to match "svn log" outputJonathan Nieder, Jul 25, 2010
  2. Eric WongJul 25, 2010
  3. 2/1 git svn: remove extraneous newline from log outputEric Wong, Jul 25, 2010
  4. Jens SeidelJul 25, 2010
  5. Eric WongJul 26, 2010
  6. Jonathan NiederJul 25, 2010
  7. Eric WongJul 25, 2010
  8. Jens SeidelJul 25, 2010
  9. Jens SeidelJul 25, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.