From: Linus Torvalds <torvalds@linux-foundation.org>
To: "Horst H. von Brand" <vonbrand@inf.utfsm.cl>
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
Andy Parkins <andyparkins@gmail.com>,
git@vger.kernel.org
Subject: Re: git-fast-import
Date: Tue, 6 Feb 2007 18:50:07 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.64.0702061832020.8424@woody.linux-foundation.org> (raw)
In-Reply-To: <200702070117.l171HGxr023213@laptop13.inf.utfsm.cl>
On Tue, 6 Feb 2007, Horst H. von Brand wrote:
>
> Shawn O. Pearce <spearce@spearce.org> wrote:
>
> [...]
>
> > What about this language?
> >
> > The time of the change is specified by `<time>` as the number of
> > seconds since the UNIX epoc (midnight, Jan 1, 1970, UTC) and is
> > written in base-10 notation using US-ASCII digits. The committer's
> > timezone is specified by `<tz>` as a positive or negative offset
> > from UTC. For example EST (which is typically 5 hours behind GMT)
> > would be expressed in `<tz>` by ``-0500'' while GMT is ``+0000''.
>
> That is /not/ a timezone! Maybe an offset from UTC.
Btw, one thing that might be a good idea to document very clearly:
- in the native git format, the offset from UTC has *nothing* to do with
the actual time itself. The time in native git is always in UTC, and
the offset from UTC does not change "time" - it's purely there to tell
in which timezone the event happened.
So 12345678 +0000 and 12345678 -0700 are *exactly*the*same*date*,
except event one happened in UTC, and the other happened in UTC-7.
- in rfc2822 format, the offset from UTC actually *changes* the date. The
date "Oct 12, 2006 20:00:00" will be two _different_ times when you say
it is in PST or in UTC.
And yes, for all I know we might get this wrong inside git too. It's easy
to get confused, because they really do mean different things.
For an example of this, do
make test-date
in git (which parses the argument using the "exact date" and "approxidate"
versions respectively, and the exact date parsing will give the internal
git representation on the first line in the middle column), and then:
./test-date "1234567890 -0800"
./test-date "1234567890 +0000"
and then try
./test-date "Fri Feb 13 15:31:30 2009 PST"
./test-date "Fri Feb 13 15:31:30 2009 UTC"
and notice how the first two (numeric) dates that differ in UTC offset
will still return the exact same seconds since the epoch:
1234567890 -0800
1234567890 +0000
but the second example (with a rfc2822-like date), will show how the
seconds-since-epoch changes, and gives:
1234567890 -0800
1234539090 +0000
respectively for those two dates.
Logical? It actually is, but you have to understand how git represents
date to see the logic. To git, the "timezone" is really totally
irrelevant. It doesn't really affect the "date" at all. At most, it
affects how you _print_ the date, and you can tell what timezone the
computer was set to when the commit was made.
And yes, I would not be at all surprised if we had some bug here where we
got it wrong occasionally.
Linus
next prev parent reply other threads:[~2007-02-07 2:50 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-06 2:31 git-fast-import Shawn O. Pearce
2007-02-06 3:18 ` git-fast-import Nicolas Pitre
2007-02-06 4:06 ` git-fast-import Nicolas Pitre
2007-02-06 5:48 ` git-fast-import Shawn O. Pearce
2007-02-06 16:35 ` git-fast-import Linus Torvalds
2007-02-06 16:56 ` git-fast-import Shawn O. Pearce
2007-02-06 17:20 ` git-fast-import Linus Torvalds
2007-02-06 18:53 ` git-fast-import Nicolas Pitre
2007-02-06 20:09 ` git-fast-import Shawn O. Pearce
2007-02-06 21:03 ` git-fast-import Nicolas Pitre
2007-02-06 21:15 ` git-fast-import Shawn O. Pearce
2007-02-06 21:42 ` git-fast-import Nicolas Pitre
2007-02-07 10:58 ` git-fast-import David Woodhouse
2007-02-06 6:12 ` git-fast-import Aneesh Kumar K.V
2007-02-06 6:18 ` git-fast-import Shawn O. Pearce
2007-02-07 4:55 ` git-fast-import Daniel Barkalow
2007-02-07 9:13 ` git-fast-import Karl Hasselström
2007-02-07 11:17 ` git-fast-import Johannes Schindelin
2007-02-07 22:55 ` git-fast-import Shawn O. Pearce
2007-02-07 23:55 ` git-fast-import Johannes Schindelin
2007-02-08 0:12 ` git-fast-import Shawn O. Pearce
2007-02-08 16:56 ` git-fast-import Linus Torvalds
2007-02-08 19:10 ` git-fast-import Shawn O. Pearce
2007-02-09 8:49 ` git-fast-import Karl Hasselström
2007-02-09 15:47 ` git-fast-import Linus Torvalds
2007-02-07 9:29 ` git-fast-import Raimund Bauer
2007-02-07 13:38 ` git-fast-import David Woodhouse
2007-02-06 9:28 ` git-fast-import Andy Parkins
2007-02-06 9:40 ` git-fast-import Shawn O. Pearce
2007-02-06 16:37 ` git-fast-import Linus Torvalds
2007-02-06 16:44 ` git-fast-import Shawn O. Pearce
2007-02-06 17:24 ` git-fast-import Linus Torvalds
2007-02-07 1:17 ` git-fast-import Horst H. von Brand
2007-02-07 2:50 ` Linus Torvalds [this message]
2007-02-07 5:53 ` git-fast-import Shawn O. Pearce
2007-02-07 9:21 ` git-fast-import Karl Hasselström
2007-02-07 22:18 ` git-fast-import Horst H. von Brand
2007-02-07 22:31 ` git-fast-import Jakub Narebski
2007-02-07 22:39 ` git-fast-import Linus Torvalds
2007-02-08 21:34 ` git-fast-import Johannes Schindelin
2007-02-07 5:46 ` git-fast-import Shawn O. Pearce
2007-02-07 4:45 ` git-fast-import Daniel Barkalow
2007-02-06 9:34 ` git-fast-import Jakub Narebski
2007-02-06 9:39 ` git-fast-import Shawn O. Pearce
2007-02-06 9:53 ` git-fast-import Jakub Narebski
2007-02-06 17:20 ` git-fast-import Shawn O. Pearce
2007-02-06 13:50 ` git-fast-import Alex Riesen
2007-02-06 17:43 ` git-fast-import Shawn O. Pearce
2007-02-06 18:02 ` git-fast-import Alex Riesen
-- strict thread matches above, loose matches on Subject: below --
2006-08-06 2:51 git-fast-import Jon Smirl
2006-08-06 3:40 ` git-fast-import Shawn Pearce
2006-08-06 4:09 ` git-fast-import Jon Smirl
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=Pine.LNX.4.64.0702061832020.8424@woody.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=andyparkins@gmail.com \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.org \
--cc=vonbrand@inf.utfsm.cl \
/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).