git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-svn messing with timezones

From
EWEric Wong <normalperson@yhbt.net>
Date
Feb 27, 2008, 07:32 UTC
Message-ID
<20080227073244.GB24316@soma>
In-Reply-To
<20080226124748.GH31792@mail.stoakes.net>
Tim Stoakes <tim@stoakes.net> wrote:
Show 24 quoted lines
> 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
Previous: Tim StoakesNext: Tim Stoakes
Message 2 of 11 in “git-svn messing with timezones”
  1. Tim StoakesFeb 26, 2008
  2. Eric WongFeb 27, 2008
  3. Tim StoakesFeb 27, 2008
  4. Johannes SchindelinFeb 27, 2008
  5. Documentation/git svn log: add a note about timezones.Miklos Vajna, Feb 27, 2008
  6. Johannes SchindelinFeb 27, 2008
  7. Documentation/git svn log: add a note about timezones.Miklos Vajna, Feb 27, 2008
  8. Johannes SchindelinFeb 27, 2008
  9. Tim StoakesFeb 27, 2008
  10. Junio C HamanoFeb 27, 2008
  11. Seth FalconFeb 27, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.