{"thread":{"id":"46502","subject":"git svn fetch --localtime produces wrong commit times","startedAt":"2017-08-02T14:47:29Z","lastAt":"2017-08-02T21:35:10Z","messageCount":2,"participants":["Urs Thuermann"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"325431","messageId":"ygf8tj26npy.fsf@tehran.isnogud.escape.de","threadId":"46502","inReplyTo":null,"subject":"git svn fetch --localtime produces wrong commit times","fromName":"Urs Thuermann","fromEmail":"urs@isnogud.escape.de","sentAt":"2017-08-02T14:36:25Z","receivedAt":"2017-08-02T14:47:29Z","isPatch":false,"sender":{"key":"urs@isnogud.escape.de","avatar":"https://avatars.githubusercontent.com/u/11499339?v=4"},"body":"In converting a SVN repository to git, the commit timestamp is\ngenerated incorrectly.  I use \"git svn fetch --localtime\" and the\noffset from UTC is always set to +0200 (probably because that is the\ncurrent local offset here, i.e. Europe/Berlin) even for times when it\nshould be +0100.\n\nFor example, in my SVN working copy I get\n\n    $ svn log -r152\n    ------------------------------------------------------------------------\n    r152 | urs | 2010-08-16 11:05:52 +0200 (Mon, 16 Aug 2010) | 2 lines\n\n    Add error checks on input file streams\n\n    ------------------------------------------------------------------------\n    $ svn log -r158\n    ------------------------------------------------------------------------\n    r158 | urs | 2010-11-24 00:24:13 +0100 (Wed, 24 Nov 2010) | 16 lines\n\n    Make code portable to Linux/amd64\n\nAfter converting to git using\n\n    $ mkdir use\n    $ cd use\n    $ git svn init -s file://$HOME/SVN/use\n    Initialized empty Git repository in /home/urs/GIT/use/.git/\n    $ git svn fetch -q -A ../ADM/git.svn-authors --localtime\n    r1 = 12cb83315be96e594a98b42db7ae57d19e0c7973 (refs/remotes/origin/trunk)\n    ...\n    r162 = 99ff393f1d64f330b14d6e06412b94fd3023d616 (refs/remotes/origin/trunk)\n    Checked out HEAD:\n      file:///home/urs/SVN/use/trunk r162\n\nI see wrong commit timestamps:\n\n    $ git log\n    ...\n    commit c6b4f7aaa66650a16de67d32fb83d541b1973331\n    Author: Urs Thuermann <urs@isnogud.escape.de>\n    Date:   Wed Nov 24 00:24:13 2010 +0200\n\n        Make code portable to Linux/amd64\n\n\n        git-svn-id: file:///home/urs/SVN/use/trunk@158 b3714422-7cff-11dd-9a33-b89007e0d947\n    ...\n    commit a9d95e506681ac5742d2d0927c93f22c541ff170\n    Author: Urs Thuermann <urs@isnogud.escape.de>\n    Date:   Mon Aug 16 11:05:52 2010 +0200\n\n        Add error checks on input file streams\n\n\n        git-svn-id: file:///home/urs/SVN/use/trunk@152 b3714422-7cff-11dd-9a33-b89007e0d947\n    ...\n\nIn revision 152 the timestamp is correct, but for revision 158 the UTC\noffset is +0200 instead of +0100.  Then, of course, also the POSIX\ntimestamp in the commit object is wrong:\n\n    $ git cat-file -p c6b4f7aaa66650a16de67d32fb83d541b1973331\n    tree ff4528220ddcf8beca9f4958fbb947d5ed85808e\n    parent edcaeb292153663664d850bafe1dad12daab4165\n    author Urs Thuermann <urs@isnogud.escape.de> 1290551053 +0200\n    committer Urs Thuermann <urs@isnogud.escape.de> 1290551053 +0200\n\n        Make code portable to Linux/amd64\n    ...\n    $ date -d@1290551053 +%F\\ %T\\ %z\n    2010-11-23 23:24:13 +0100\n\nThe correct timestamp would be 2010-11-24 00:24:13 +0100, or, as a\nPOSIX time_t 1290554653.\n\nI could find the bug grepping through /usr/lib/git-core/git-svn, maybe\nit's in GIT::SVN::Fetcher or some other GIT::SVN module.\n\nIs a fix available for this bug?\n\nurs\n"},{"id":"325482","messageId":"ygfpocd7iy8.fsf@tehran.isnogud.escape.de","threadId":"46502","inReplyTo":"ygf8tj26npy.fsf@tehran.isnogud.escape.de","subject":"Re: git svn fetch --localtime produces wrong commit times","fromName":"Urs Thuermann","fromEmail":"urs@isnogud.escape.de","sentAt":"2017-08-02T21:34:07Z","receivedAt":"2017-08-02T21:35:10Z","isPatch":false,"sender":{"key":"urs@isnogud.escape.de","avatar":"https://avatars.githubusercontent.com/u/11499339?v=4"},"body":"Urs Thuermann <urs@isnogud.escape.de> writes:\n\n> I could find the bug grepping through /usr/lib/git-core/git-svn, maybe\n> it's in GIT::SVN::Fetcher or some other GIT::SVN module.\n\nOops, that should be \"could *not* find\", of course.\n\nurs\n"}]}