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
Jonathan Nieder <jrnieder@gmail.com>
Date
Jul 25, 2010, 08:37 UTC
Message-ID
<20100725083708.GB22213@burratino>
In-Reply-To
<20100725081057.GA22373@dcvr.yhbt.net>
Eric Wong wrote:
Show 8 quoted lines
> @@ -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
Previous: Eric WongNext: Eric Wong
Message 6 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.