summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d43c07b)
raw | patch | inline | side by side (parent: d43c07b)
author | Ben Walton <bwalton@artsci.utoronto.ca> | |
Tue, 24 Feb 2009 19:44:49 +0000 (14:44 -0500) | ||
committer | Eric Wong <normalperson@yhbt.net> | |
Tue, 24 Feb 2009 21:45:36 +0000 (13:45 -0800) |
%z isn't available on all platforms in the date formatting
routines. Provide a workalike capability that should be
more portable.
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Acked-by: Eric Wong <normalperson@yhbt.net>
routines. Provide a workalike capability that should be
more portable.
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Acked-by: Eric Wong <normalperson@yhbt.net>
git-svn.perl | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index d8476c81eefd4cbbe178894dc2bcc39ffdadd6e9..d967594ee70a53c1397da76f4b977191c4fd0561 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
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/;
}
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 {