# git-svn messing with timezones

11 messages from 2008-02-26 to 2008-02-27. Participants: Tim Stoakes, Eric Wong, Johannes Schindelin, Miklos Vajna, Seth Falcon, Junio C Hamano.
Thread: https://gitlist.dev/t/12328

## Tim Stoakes, 2008-02-26 12:47

Subject: git-svn messing with timezones
Message-ID: <20080226124748.GH31792@mail.stoakes.net>
URL: https://gitlist.dev/e/20080226124748.GH31792%40mail.stoakes.net

```
Hi all,

When I commit to git, the log shows the correct timezone:
  Date:   Tue Feb 26 23:10:24 2008 +1030

However, when I then dcommit this to SVN with git-svn, the timezone gets
mangled. If I now 'git log', the same commit shows
  Date:   Tue Feb 26 12:40:24 2008 +0000

The 'svn log' of that same revision shows the correct timezone:
r151 | foo | 2008-02-26 23:10:24 +1030 (Tue, 26 Feb 2008) | 2 lines
so, I know it's git-svn doing it, not svn itself.

The same mangling has happened to commits that came through the original
git-svn import, and subsequent 'git-svn rebase's.

I've tried things like:
$ TZ=Australia/Adelaide git svn dcommit
all end in the same result - UTC appears in the logs.

I'm using:
git version 1.5.4.3

Can anyone help?
Thanks
Tim

-- 
Tim Stoakes

```

## Eric Wong, 2008-02-27 07:32

Subject: Re: git-svn messing with timezones
Message-ID: <20080227073244.GB24316@soma>
URL: https://gitlist.dev/e/20080227073244.GB24316%40soma
In-Reply-To: <20080226124748.GH31792@mail.stoakes.net>

```
Tim Stoakes <tim@stoakes.net> wrote:
> Hi all,
> 
> When I commit to git, the log shows the correct timezone:
>   Date:   Tue Feb 26 23:10:24 2008 +1030
> 
> However, when I then dcommit this to SVN with git-svn, the timezone gets
> mangled. If I now 'git log', the same commit shows
>   Date:   Tue Feb 26 12:40:24 2008 +0000
> 
> The 'svn log' of that same revision shows the correct timezone:
> r151 | foo | 2008-02-26 23:10:24 +1030 (Tue, 26 Feb 2008) | 2 lines
> so, I know it's git-svn doing it, not svn itself.
> 
> The same mangling has happened to commits that came through the original
> git-svn import, and subsequent 'git-svn rebase's.
> 
> I've tried things like:
> $ TZ=Australia/Adelaide git svn dcommit
> all end in the same result - UTC appears in the logs.
> 
> I'm using:
> git version 1.5.4.3
> 
> Can anyone help?

Hi Tim,

This is actually the intended behavior of git-svn.

SVN itself only stores times in UTC and nothing else.  The SVN
repository itself has no timezone information (unless the server it was
on is misconfigured :)

The regular svn client converts the UTC time to the local time (or
based on the TZ= environment).  Using "git svn log" should mimic the
timezone behavior of the regular svn client.

git-svn will only import times as UTC because that's what SVN
gives it.

As a side effect, this also makes it easier for multiple users to
independently create repositories that result in the same commit SHA1s
(and one of the reasons for using dcommit over git svn set-tree).

-- 
Eric Wong

```

## Tim Stoakes, 2008-02-27 10:26

Subject: Re: git-svn messing with timezones
Message-ID: <20080227102631.GJ30300@mail.stoakes.net>
URL: https://gitlist.dev/e/20080227102631.GJ30300%40mail.stoakes.net
In-Reply-To: <20080227073244.GB24316@soma>

```
Eric Wong(normalperson@yhbt.net)@260208-23:32:
> The regular svn client converts the UTC time to the local time (or
> based on the TZ= environment).  Using "git svn log" should mimic the
> timezone behavior of the regular svn client.

Ah indeed, `git-svn log` does show the correct TZ. How annoying!

My workflow is to work with native git as much as possible, and interact
with svn as little as is required. This means I have to remember to run
one command to see sane logs of git commits that happen to also be svn
commits, and another one for the normal git commits. There is no
transparency here.

Thanks for clearing that up though Eric. Is it documented anywhere?

Tim

-- 
Tim Stoakes

```

## Johannes Schindelin, 2008-02-27 10:40

Subject: Re: git-svn messing with timezones
Message-ID: <alpine.LSU.1.00.0802271039220.22527@racer.site>
URL: https://gitlist.dev/e/alpine.LSU.1.00.0802271039220.22527%40racer.site
In-Reply-To: <20080227102631.GJ30300@mail.stoakes.net>

```
Hi,

On Wed, 27 Feb 2008, Tim Stoakes wrote:

> Ah indeed, `git-svn log` does show the correct TZ. How annoying!

Note: if all you want is such a strange behaviour as svn's (I mean, why 
does it insist to show the dates as if they were done in _your_ 
timezone?):

	git log --date=local

> Is it documented anywhere?

AFAICT it waits to be written.  By you.

Ciao,
Dscho

```

## Miklos Vajna, 2008-02-27 12:29

Subject: [PATCH] Documentation/git svn log: add a note about timezones.
Message-ID: <20080227122929.GS31441@genesis.frugalware.org>
URL: https://gitlist.dev/e/20080227122929.GS31441%40genesis.frugalware.org
In-Reply-To: <alpine.LSU.1.00.0802271039220.22527@racer.site>

```
git svn log mimics the timezone converting behaviour of svn log, but this was
undocumented.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---

On Wed, Feb 27, 2008 at 10:40:37AM +0000, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Note: if all you want is such a strange behaviour as svn's (I mean, why
> does it insist to show the dates as if they were done in _your_
> timezone?):
>
>       git log --date=local
>
> > Is it documented anywhere?
>
> AFAICT it waits to be written.  By you.

something like this?


 Documentation/git-svn.txt |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 340f1be..e1babf3 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -160,6 +160,10 @@ New features:
 --
 +
 Any other arguments are passed directly to `git log'
++
+NOTE: SVN itself only stores times in UTC and nothing else. The regular svn
+client converts the UTC time to the local time (or based on the TZ=
+environment). This command has the same behaviour.
 
 'blame'::
        Show what revision and author last modified each line of a file. This is
-- 
1.5.4

```

## Johannes Schindelin, 2008-02-27 12:33

Subject: Re: [PATCH] Documentation/git svn log: add a note about timezones.
Message-ID: <alpine.LSU.1.00.0802271231080.22527@racer.site>
URL: https://gitlist.dev/e/alpine.LSU.1.00.0802271231080.22527%40racer.site
In-Reply-To: <20080227122929.GS31441@genesis.frugalware.org>

```
Hi,

On Wed, 27 Feb 2008, Miklos Vajna wrote:

> git svn log mimics the timezone converting behaviour of svn log, but this was

This line is definitely too long.  Please make commit messages readable on 
an 80-character display with a 4-character indent, i.e. 76 
characters/line.

> On Wed, Feb 27, 2008 at 10:40:37AM +0000, Johannes Schindelin 
> <Johannes.Schindelin@gmx.de> wrote:
> > Note: if all you want is such a strange behaviour as svn's (I mean, 
> > why does it insist to show the dates as if they were done in _your_ 
> > timezone?):
> >
> >       git log --date=local
> >
> > > Is it documented anywhere?
> >
> > AFAICT it waits to be written.  By you.
> 
> something like this?

Yes, very nice.  Although I find it sad that an opportunity was lost for a 
complainer to make good.

> diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
> index 340f1be..e1babf3 100644
> --- a/Documentation/git-svn.txt
> +++ b/Documentation/git-svn.txt
> @@ -160,6 +160,10 @@ New features:
>  --
>  +
>  Any other arguments are passed directly to `git log'
> ++
> +NOTE: SVN itself only stores times in UTC and nothing else. The regular svn
> +client converts the UTC time to the local time (or based on the TZ=
> +environment). This command has the same behaviour.
>  
>  'blame'::
>         Show what revision and author last modified each line of a file. This is

I think that this note should come before the "Any other arguments" line.

Ciao,
Dscho

```

## Miklos Vajna, 2008-02-27 13:13

Subject: [PATCH] Documentation/git svn log: add a note about timezones.
Message-ID: <20080227131300.GT31441@genesis.frugalware.org>
URL: https://gitlist.dev/e/20080227131300.GT31441%40genesis.frugalware.org
In-Reply-To: <alpine.LSU.1.00.0802271231080.22527@racer.site>

```
git svn log mimics the timezone converting behaviour of svn log, but
this was undocumented.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---

On Wed, Feb 27, 2008 at 12:33:22PM +0000, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > git svn log mimics the timezone converting behaviour of svn log, but this was
>
> This line is definitely too long.  Please make commit messages readable on
> an 80-character display with a 4-character indent, i.e. 76
> characters/line.

right, corrected.

> Yes, very nice.  Although I find it sad that an opportunity was lost for a
> complainer to make good.

oops :(

> > ++
> > +NOTE: SVN itself only stores times in UTC and nothing else. The regular svn
> > +client converts the UTC time to the local time (or based on the TZ=
> > +environment). This command has the same behaviour.
> >
> >  'blame'::
> >         Show what revision and author last modified each line of a file. This is
>
> I think that this note should come before the "Any other arguments" line.

moved.

 Documentation/git-svn.txt |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 340f1be..bec9acc 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -159,6 +159,10 @@ New features:
 	our version of --pretty=oneline
 --
 +
+NOTE: SVN itself only stores times in UTC and nothing else. The regular svn
+client converts the UTC time to the local time (or based on the TZ=
+environment). This command has the same behaviour.
++
 Any other arguments are passed directly to `git log'
 
 'blame'::
-- 
1.5.4

```

## Johannes Schindelin, 2008-02-27 13:15

Subject: Re: [PATCH] Documentation/git svn log: add a note about timezones.
Message-ID: <alpine.LSU.1.00.0802271315370.22527@racer.site>
URL: https://gitlist.dev/e/alpine.LSU.1.00.0802271315370.22527%40racer.site
In-Reply-To: <20080227131300.GT31441@genesis.frugalware.org>

```
Hi,

On Wed, 27 Feb 2008, Miklos Vajna wrote:

> git svn log mimics the timezone converting behaviour of svn log, but
> this was undocumented.

Thanks,
Dscho

```

## Seth Falcon, 2008-02-27 16:21

Subject: Re: git-svn messing with timezones
Message-ID: <m2zltmnzey.fsf@userprimary.net>
URL: https://gitlist.dev/e/m2zltmnzey.fsf%40userprimary.net
In-Reply-To: <20080227102631.GJ30300@mail.stoakes.net>

```
Tim Stoakes <tim@stoakes.net> writes:
> Ah indeed, `git-svn log` does show the correct TZ. How annoying!
>
> My workflow is to work with native git as much as possible, and interact
> with svn as little as is required. This means I have to remember to run
> one command to see sane logs of git commits that happen to also be svn
> commits, and another one for the normal git commits. There is no
> transparency here.

You might find it convenient to set an alias in ~/gitconfig like:

    [alias]
            llog = log --date=local

The you can review commits in your TZ via 'git llog'.

+ seth

-- 
Seth Falcon | seth@userprimary.net | blog: http://userprimary.net/user/

```

## Tim Stoakes, 2008-02-27 23:09

Subject: Re: git-svn messing with timezones
Message-ID: <20080227230916.GF18074@mail.stoakes.net>
URL: https://gitlist.dev/e/20080227230916.GF18074%40mail.stoakes.net
In-Reply-To: <alpine.LSU.1.00.0802271039220.22527@racer.site>

```
Johannes Schindelin(Johannes.Schindelin@gmx.de)@270208-10:40:
> Note: if all you want is such a strange behaviour as svn's (I mean, why 
> does it insist to show the dates as if they were done in _your_ 
> timezone?):
> 
> 	git log --date=local

Ah excellent, that's what I want I think. I'm stuck with SVN for work,
and reviewing commits that appeared to happen at 4am does not do much
for my sanity!

Thanks all.

Tim

-- 
Tim Stoakes

```

## Junio C Hamano, 2008-02-27 23:23

Subject: Re: git-svn messing with timezones
Message-ID: <7vlk56ouff.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vlk56ouff.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <20080227230916.GF18074@mail.stoakes.net>

```
Tim Stoakes <tim@stoakes.net> writes:

> Johannes Schindelin(Johannes.Schindelin@gmx.de)@270208-10:40:
>> Note: if all you want is such a strange behaviour as svn's (I mean, why 
>> does it insist to show the dates as if they were done in _your_ 
>> timezone?):
>> 
>> 	git log --date=local
>
> Ah excellent, that's what I want I think. I'm stuck with SVN for work,
> and reviewing commits that appeared to happen at 4am does not do much
> for my sanity!

FYI ("you" not referring to Tim in particular but the list
readers in general), the same --date=local can be used in a
repository that talk with CVS.

```
