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

5 messages from 2017-08-05 to 2017-08-08. Participants: Urs Thuermann, Junio C Hamano, Eric Wong.
Thread: https://gitlist.dev/t/46516

## Urs Thuermann, 2017-08-05 00:12

Subject: [PATCH] git svn fetch: Create correct commit timestamp when using --localtime
Message-ID: <ygf8tiyx480.fsf@tehran.isnogud.escape.de>
URL: https://gitlist.dev/e/ygf8tiyx480.fsf%40tehran.isnogud.escape.de

```
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(-)

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, 2017-08-07 22:08

Subject: Re: [PATCH] git svn fetch: Create correct commit timestamp when using --localtime
Message-ID: <xmqqlgmvni8x.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqlgmvni8x.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <ygf8tiyx480.fsf@tehran.isnogud.escape.de>

```
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?

>
> 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, 2017-08-08 02:42

Subject: Re: [PATCH] git svn fetch: Create correct commit timestamp when using --localtime
Message-ID: <20170808024239.GA2915@starla>
URL: https://gitlist.dev/e/20170808024239.GA2915%40starla
In-Reply-To: <xmqqlgmvni8x.fsf@gitster.mtv.corp.google.com>

```
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.

```

## Junio C Hamano, 2017-08-08 16:57

Subject: Re: [PATCH] git svn fetch: Create correct commit timestamp when using --localtime
Message-ID: <xmqqfud2c80z.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqfud2c80z.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <20170808024239.GA2915@starla>

```
Eric Wong <e@80x24.org> writes:

> 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, 2017-08-08 18:56

Subject: Re: [PATCH] git svn fetch: Create correct commit timestamp when using --localtime
Message-ID: <ygfinhxzy55.fsf@tehran.isnogud.escape.de>
URL: https://gitlist.dev/e/ygfinhxzy55.fsf%40tehran.isnogud.escape.de
In-Reply-To: <xmqqfud2c80z.fsf@gitster.mtv.corp.google.com>

```
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

```
