From: Christoph Anton Mitterer <calestyo@scientia.net>
To: git@vger.kernel.org
Subject: [BUG] git svn's --localtime seems to corrupt time zones
Date: Mon, 16 Mar 2015 18:31:47 +0100 [thread overview]
Message-ID: <1426527107.18487.14.camel@scientia.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 2474 bytes --]
Hi.
I was converting some very old svn repos of mine into git using git svn,
and since I didn't fully trust the conversion process I wrote a small
tool which goes through all commits/revisions (there were no branches or
non-linear stuff involved in these svn repos) and compares the author
names, dates, commit messages and file tree for each revision/commit.
I used something like:
git svn clone --trunk=/ --no-metadata --localtime --preserve-empty-dirs
--authors-file=~/authors.txt file:///...
and used --localtime since I wanted the times/dates with the original
time zones (just as it seems to happen with a normal git repo as well).
The svn repo contained commits with different time zones (mostly because
of daylight saving times).
With the diff tool I've noticed the following behaviour:
Apparently, whenever --localtime is given, git svn takes SVN's time as
is, completely ignoring it's time zone, storing *everything* in the
current(!) local time zone.
This has IMHO two bugs:
1) it doesn't do what one expects and what the manpage promises:
> --localtime
> Store Git commit times in the local time zone instead of UTC.
> This makes git log (even without --date=local) show the same
> times that svn log would in the local time zone.
=> This isn't true, cause while svn log shows the differing time zones
(in my case +0100 and +0200 when the DST changes), git log shows
everything in +0100.
2) but even worse, as said above, it seems to ignore the time zones from
SVN, so when I'm currently in +0100, all the svn times from +0100 will
be correct, but all the ones that were stored in +0200 (or anything
else) will have exactly the same time value just the zone changed to
+0100, thereby corrupting the time.
Example svn log output:
$ svn log | grep ^r | head -n 4
r781 | calestyo | 2008-08-12 23:26:12 +0200 (Tue, 12 Aug 2008) | 2 lines
r780 | calestyo | 2008-01-11 01:16:59 +0100 (Fri, 11 Jan 2008) | 2 lines
r779 | calestyo | 2008-01-06 19:43:08 +0100 (Sun, 06 Jan 2008) | 2 lines
r778 | calestyo | 2008-01-06 18:51:37 +0100 (Sun, 06 Jan 2008) | 2 lines
And from the corresponding "converted" git repo:
$ git log --date=iso8601 | grep ^Date: | head -n 4
Date: 2008-08-12 23:26:12 +0100
Date: 2008-01-11 01:16:59 +0100
Date: 2008-01-06 19:43:08 +0100
Date: 2008-01-06 18:51:37 +0100
All packages from Debian sid, i.e. git 2.1.4 and subversion 1.8.10.
Any ideas?
Cheers,
Chris.
[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5313 bytes --]
reply other threads:[~2015-03-16 17:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1426527107.18487.14.camel@scientia.net \
--to=calestyo@scientia.net \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).