git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-svn messing with timezones
@ 2008-02-26 12:47 Tim Stoakes
  2008-02-27  7:32 ` Eric Wong
  0 siblings, 1 reply; 11+ messages in thread
From: Tim Stoakes @ 2008-02-26 12:47 UTC (permalink / raw)
  To: git; +Cc: normalperson

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: git-svn messing with timezones
  2008-02-26 12:47 git-svn messing with timezones Tim Stoakes
@ 2008-02-27  7:32 ` Eric Wong
  2008-02-27 10:26   ` Tim Stoakes
  0 siblings, 1 reply; 11+ messages in thread
From: Eric Wong @ 2008-02-27  7:32 UTC (permalink / raw)
  To: Tim Stoakes; +Cc: git

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: git-svn messing with timezones
  2008-02-27  7:32 ` Eric Wong
@ 2008-02-27 10:26   ` Tim Stoakes
  2008-02-27 10:40     ` Johannes Schindelin
  2008-02-27 16:21     ` Seth Falcon
  0 siblings, 2 replies; 11+ messages in thread
From: Tim Stoakes @ 2008-02-27 10:26 UTC (permalink / raw)
  To: Eric Wong; +Cc: git

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: git-svn messing with timezones
  2008-02-27 10:26   ` Tim Stoakes
@ 2008-02-27 10:40     ` Johannes Schindelin
  2008-02-27 12:29       ` [PATCH] Documentation/git svn log: add a note about timezones Miklos Vajna
  2008-02-27 23:09       ` git-svn messing with timezones Tim Stoakes
  2008-02-27 16:21     ` Seth Falcon
  1 sibling, 2 replies; 11+ messages in thread
From: Johannes Schindelin @ 2008-02-27 10:40 UTC (permalink / raw)
  To: Tim Stoakes; +Cc: Eric Wong, git

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] Documentation/git svn log: add a note about timezones.
  2008-02-27 10:40     ` Johannes Schindelin
@ 2008-02-27 12:29       ` Miklos Vajna
  2008-02-27 12:33         ` Johannes Schindelin
  2008-02-27 23:09       ` git-svn messing with timezones Tim Stoakes
  1 sibling, 1 reply; 11+ messages in thread
From: Miklos Vajna @ 2008-02-27 12:29 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin, Tim Stoakes, Eric Wong, git

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] Documentation/git svn log: add a note about timezones.
  2008-02-27 12:29       ` [PATCH] Documentation/git svn log: add a note about timezones Miklos Vajna
@ 2008-02-27 12:33         ` Johannes Schindelin
  2008-02-27 13:13           ` Miklos Vajna
  0 siblings, 1 reply; 11+ messages in thread
From: Johannes Schindelin @ 2008-02-27 12:33 UTC (permalink / raw)
  To: Miklos Vajna; +Cc: Junio C Hamano, Tim Stoakes, Eric Wong, git

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] Documentation/git svn log: add a note about timezones.
  2008-02-27 12:33         ` Johannes Schindelin
@ 2008-02-27 13:13           ` Miklos Vajna
  2008-02-27 13:15             ` Johannes Schindelin
  0 siblings, 1 reply; 11+ messages in thread
From: Miklos Vajna @ 2008-02-27 13:13 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin, Tim Stoakes, Eric Wong, git

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] Documentation/git svn log: add a note about timezones.
  2008-02-27 13:13           ` Miklos Vajna
@ 2008-02-27 13:15             ` Johannes Schindelin
  0 siblings, 0 replies; 11+ messages in thread
From: Johannes Schindelin @ 2008-02-27 13:15 UTC (permalink / raw)
  To: Miklos Vajna; +Cc: Junio C Hamano, Tim Stoakes, Eric Wong, git

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: git-svn messing with timezones
  2008-02-27 10:26   ` Tim Stoakes
  2008-02-27 10:40     ` Johannes Schindelin
@ 2008-02-27 16:21     ` Seth Falcon
  1 sibling, 0 replies; 11+ messages in thread
From: Seth Falcon @ 2008-02-27 16:21 UTC (permalink / raw)
  To: Tim Stoakes; +Cc: Eric Wong, git

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/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: git-svn messing with timezones
  2008-02-27 10:40     ` Johannes Schindelin
  2008-02-27 12:29       ` [PATCH] Documentation/git svn log: add a note about timezones Miklos Vajna
@ 2008-02-27 23:09       ` Tim Stoakes
  2008-02-27 23:23         ` Junio C Hamano
  1 sibling, 1 reply; 11+ messages in thread
From: Tim Stoakes @ 2008-02-27 23:09 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Eric Wong, git

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: git-svn messing with timezones
  2008-02-27 23:09       ` git-svn messing with timezones Tim Stoakes
@ 2008-02-27 23:23         ` Junio C Hamano
  0 siblings, 0 replies; 11+ messages in thread
From: Junio C Hamano @ 2008-02-27 23:23 UTC (permalink / raw)
  To: Tim Stoakes; +Cc: Johannes Schindelin, Eric Wong, git

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.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-02-27 23:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-26 12:47 git-svn messing with timezones Tim Stoakes
2008-02-27  7:32 ` Eric Wong
2008-02-27 10:26   ` Tim Stoakes
2008-02-27 10:40     ` Johannes Schindelin
2008-02-27 12:29       ` [PATCH] Documentation/git svn log: add a note about timezones Miklos Vajna
2008-02-27 12:33         ` Johannes Schindelin
2008-02-27 13:13           ` Miklos Vajna
2008-02-27 13:15             ` Johannes Schindelin
2008-02-27 23:09       ` git-svn messing with timezones Tim Stoakes
2008-02-27 23:23         ` Junio C Hamano
2008-02-27 16:21     ` Seth Falcon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).