summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-02-24 21:13:32 -0800
committerJunio C Hamano <gitster@pobox.com>2009-02-24 21:13:32 -0800
commit48b6026e17f22aff8931d45a62a7a240533efe72 (patch)
treeae8772a18db47b1b5e3e0603eca7f943057dc34d
parent3ca936422212370481850d67cab80b1e517b2d80 (diff)
parente871784132038a500f3390859da3bbe95b9a0fc2 (diff)
downloadgit-48b6026e17f22aff8931d45a62a7a240533efe72.tar.gz
Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn: git-svn fix to avoid using strftime %z
-rwxr-xr-xgit-svn.perl8
1 files changed, 7 insertions, 1 deletions
diff --git a/git-svn.perl b/git-svn.perl
index d8476c81ee..d967594ee7 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -4630,6 +4630,7 @@ package Git::SVN::Log;
use strict;
use warnings;
use POSIX qw/strftime/;
+use Time::Local;
use constant commit_log_separator => ('-' x 72) . "\n";
use vars qw/$TZ $limit $color $pager $non_recursive $verbose $oneline
%rusers $show_commit $incremental/;
@@ -4736,7 +4737,12 @@ sub run_pager {
}
sub format_svn_date {
- return strftime("%Y-%m-%d %H:%M:%S %z (%a, %d %b %Y)", localtime(shift));
+ # some systmes don't handle or mishandle %z, so be creative.
+ my $t = shift;
+ 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));
}
sub parse_git_date {