Hi Jonathan,
yep, one has to apply a filter, also to remove the addional empty lines (and
non matching spaces at end of lines).
Ah, git svn ignores any locale, this explains the problem.
I tried to fix both.
This remains open. Probably that can be solved by setting a git config
option and resyncing all git svn history from git.
Please note that I don't know Perl. Please check my changes very carefully!
--- /usr/lib/git-core/git-svn.orig 2010-04-11 19:14:03.000000000 +0200
+++ /usr/lib/git-core/git-svn 2010-04-27 12:50:51.000000000 +0200
@@ -50,6 +50,7 @@
use Carp qw/croak/;
use Digest::MD5;
use IO::File qw//;
+use Locale::gettext;
Let's use the gettext system which is also used by Subversion and is the
quasi standard for translations. I hope this doesn't increase the
dependencies of git-svn.
@@ -5492,7 +5495,8 @@
my $gm = timelocal(gmtime($t));
my $sign = qw( + + - )[ $t <=> $gm ];
my $gmoff = sprintf("%s%02d%02d", $sign, (gmtime(abs($t - $gm)))[2,1]);
- return strftime("%Y-%m-%d %H:%M:%S $gmoff (%a, %d %b %Y)", localtime($t));
+ my $d = Locale::gettext->domain("subversion");
I'm not sure whether it is efficient to perform this call here. Maybe it
should be a (global???) variable. Let's reuse existing Subversion
translations (why not -?)).
+ return strftime("%Y-%m-%d %H:%M:%S $gmoff" . $d->get(" (%a, %d %b %Y)"), localtime($t));
Only the last part can be changed by translators in Subversion. See trunk,
file libsvn_subr/time.c:
/* Machine parseable part, generated by apr_snprintf. */
#define HUMAN_TIMESTAMP_FORMAT "%.4d-%.2d-%.2d %.2d:%.2d:%.2d %+.2d%.2d"
/* Human explanatory part, generated by apr_strftime as "Sat, 01 Jan 2000"
* */
#define human_timestamp_format_suffix _(" (%a, %d %b %Y)")
@@ -5598,20 +5603,15 @@
}
$nr_line = scalar @$l;
if (!$nr_line) {
- print "1 line\n\n\n";
+ print sprintf($d->nget(" | %d line", " | %d lines", 1), 1), "\n\n\n";
Please put
sprintf($d->nget(" | %d line", " | %d lines", n), n)
into a function (which integer parameter n) to avoid code duplication. The
first n selects the string to be used (the singular or plural form), the
second replaces %d by the number.
Since Subversion has the string " | %d line" translated, we have to match
it (and cannot request the translation for "line").
I tried it and it works well.
Jens