threads / patch / 18058

patchgit-svn - return original format_svn_date semantics

Subject: [PATCH] git-svn - return original format_svn_date semantics

## tl;dr

2 messages between Feb 28, 2009 and Feb 28, 2009. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Ben Walton· Feb 28, 2009, 03:11 UTC · lore

When %z was removed from the strftime call and subsituted with a local gmt offset calculation, time() was no longer the default for all time functions as it was with the previous localtime(shift). This is now corrected so that format_svn_time behaves as it used to.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
---
 git-svn.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to git-svn.perl +1 −1
diff --git a/git-svn.perl b/git-svn.perl
index d967594..55702d0 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -4738,7 +4738,7 @@ sub run_pager {
 
 sub format_svn_date {
 	# some systmes don't handle or mishandle %z, so be creative.
-	my $t = shift;
+	my $t = shift || time;
 	my $gm = timelocal(gmtime($t));
 	my $sign = qw( + + - )[ $t <=> $gm ];
 	my $gmoff = sprintf("%s%02d%02d", $sign, (gmtime(abs($t - $gm)))[2,1]);
-- 
1.6.0.4
Eric Wong· Feb 28, 2009, 03:22 UTC · re: Ben Walton · lore

Re: [PATCH] git-svn - return original format_svn_date semantics

Ben Walton <bwalton@artsci.utoronto.ca> wrote:
Show 6 quoted lines
> When %z was removed from the strftime call and subsituted with a
> local gmt offset calculation, time() was no longer the default for
> all time functions as it was with the previous localtime(shift).
> This is now corrected so that format_svn_time behaves as it used to.
> 
> Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Thanks Ben,

I'm pretty sure there's another bug lurking in there with the "info" command, but this should at least cleanup the output as a stopgap measure until somebody has time to properly fix it.

Acked-by: Eric Wong <normalperson@yhbt.net>
Show 19 quoted lines
> ---
>  git-svn.perl |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/git-svn.perl b/git-svn.perl
> index d967594..55702d0 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -4738,7 +4738,7 @@ sub run_pager {
>  
>  sub format_svn_date {
>  	# some systmes don't handle or mishandle %z, so be creative.
> -	my $t = shift;
> +	my $t = shift || time;
>  	my $gm = timelocal(gmtime($t));
>  	my $sign = qw( + + - )[ $t <=> $gm ];
>  	my $gmoff = sprintf("%s%02d%02d", $sign, (gmtime(abs($t - $gm)))[2,1]);
> -- 
> 1.6.0.4

← back to recent threads