threads / patch / 46516

patchgit svn fetch: Create correct commit timestamp when using --localtime

Subject: [PATCH] git svn fetch: Create correct commit timestamp when using --localtime

## tl;dr

5 messages between Aug 5, 2017 and Aug 8, 2017. Diffs are folded; open one to read it.

replies: 4people: 3as markdown or json

Urs Thuermann· Aug 5, 2017, 00:12 UTC · lore

In parse_svn_date() prepend the correct UTC offset to the timestamp returned. This is the offset in effect at the commit time instead of the offset in effect at calling time.

Signed-off-by: Urs Thuermann <urs@isnogud.escape.de>
---
 perl/Git/SVN.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to perl/Git/SVN.pm +1 −1
diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm
index 98518f4..bc4eed3 100644
--- a/perl/Git/SVN.pm
+++ b/perl/Git/SVN.pm
@@ -1416,7 +1416,7 @@ sub parse_svn_date {
 			delete $ENV{TZ};
 		}
 
-		my $our_TZ = get_tz_offset();
+		my $our_TZ = get_tz_offset($epoch_in_UTC);
 
 		# This converts $epoch_in_UTC into our local timezone.
 		my ($sec, $min, $hour, $mday, $mon, $year,
-- 
2.1.4
Junio C Hamano· Aug 7, 2017, 22:08 UTC · re: Urs Thuermann · lore

Re: [PATCH] git svn fetch: Create correct commit timestamp when using --localtime

Urs Thuermann <urs@isnogud.escape.de> writes:
Show 8 quoted lines
> In parse_svn_date() prepend the correct UTC offset to the timestamp
> returned.  This is the offset in effect at the commit time instead of
> the offset in effect at calling time.
>
> Signed-off-by: Urs Thuermann <urs@isnogud.escape.de>
> ---
>  perl/Git/SVN.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
Thanks; sounds sensible.  
Eric?
Show 14 quoted lines
>
> diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm
> index 98518f4..bc4eed3 100644
> --- a/perl/Git/SVN.pm
> +++ b/perl/Git/SVN.pm
> @@ -1416,7 +1416,7 @@ sub parse_svn_date {
>  			delete $ENV{TZ};
>  		}
>  
> -		my $our_TZ = get_tz_offset();
> +		my $our_TZ = get_tz_offset($epoch_in_UTC);
>  
>  		# This converts $epoch_in_UTC into our local timezone.
>  		my ($sec, $min, $hour, $mday, $mon, $year,
Eric Wong· Aug 8, 2017, 02:42 UTC · re: Junio C Hamano · lore

Re: [PATCH] git svn fetch: Create correct commit timestamp when using --localtime

Junio C Hamano <gitster@pobox.com> wrote:
Show 14 quoted lines
> Urs Thuermann <urs@isnogud.escape.de> writes:
> 
> > In parse_svn_date() prepend the correct UTC offset to the timestamp
> > returned.  This is the offset in effect at the commit time instead of
> > the offset in effect at calling time.
> >
> > Signed-off-by: Urs Thuermann <urs@isnogud.escape.de>
> > ---
> >  perl/Git/SVN.pm | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Thanks; sounds sensible.  
> 
> Eric?

Yep, seems alright. Can you apply directly? Been a bit preoccupied as of late. Thanks.

Junio C Hamano· Aug 8, 2017, 16:57 UTC · re: Eric Wong · lore

Re: [PATCH] git svn fetch: Create correct commit timestamp when using --localtime

Eric Wong <e@80x24.org> writes:
Show 18 quoted lines
> Junio C Hamano <gitster@pobox.com> wrote:
>> Urs Thuermann <urs@isnogud.escape.de> writes:
>> 
>> > In parse_svn_date() prepend the correct UTC offset to the timestamp
>> > returned.  This is the offset in effect at the commit time instead of
>> > the offset in effect at calling time.
>> >
>> > Signed-off-by: Urs Thuermann <urs@isnogud.escape.de>
>> > ---
>> >  perl/Git/SVN.pm | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> Thanks; sounds sensible.  
>> 
>> Eric?
>
> Yep, seems alright.  Can you apply directly?
> Been a bit preoccupied as of late.  Thanks.
Surely, I'll just add your Reviewed-by: myself ;-)
Thanks.
Urs Thuermann· Aug 8, 2017, 18:56 UTC · re: Junio C Hamano · lore

Re: [PATCH] git svn fetch: Create correct commit timestamp when using --localtime

Junio C Hamano <gitster@pobox.com> writes:
> > Yep, seems alright.  Can you apply directly?
> > Been a bit preoccupied as of late.  Thanks.
> 
> Surely, I'll just add your Reviewed-by: myself ;-)

OK, thanks. This will fix the bug I've reported here a week or so ago (see the References header).

urs

← back to recent threads