All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Horst H. von Brand" <vonbrand@inf.utfsm.cl>,
	Andy Parkins <andyparkins@gmail.com>,
	git@vger.kernel.org
Subject: Re: git-fast-import
Date: Wed, 7 Feb 2007 00:53:52 -0500	[thread overview]
Message-ID: <20070207055352.GB7138@spearce.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0702061832020.8424@woody.linux-foundation.org>

Linus Torvalds <torvalds@linux-foundation.org> wrote:
> 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.

Here is the current language relating to date parsing in gfi:

Date Formats
~~~~~~~~~~~~
The following date formats are supported.  A frontend should select
the format it will use for this import by passing the format name
in the `--date-format=<fmt>` command line option.

`raw`::
	This is the Git native format and is `<time> SP <offutc>`.
	It is also gfi's default format, if `--date-format` was
	not specified.
+
The time of the event is specified by `<time>` as the number of
seconds since the UNIX epoch (midnight, Jan 1, 1970, UTC) and is
written as an ASCII decimal integer.
+
The local offset is specified by `<offutc>` as a positive or negative
offset from UTC.  For example EST (which is 5 hours behind UTC)
would be expressed in `<tz>` by ``-0500'' while UTC is ``+0000''.
The local offset does not affect `<time>`; it is used only as an
advisement to help formatting routines display the timestamp.
+
If the local offset is not available in the source material, use
``+0000'', or the most common local offset.  For example many
organizations have a CVS repository which has only ever been accessed
by users who are located in the same location and timezone.  In this
case the offset from UTC can be easily assumed.
+
Unlike the `rfc2822` format, this format is very strict.  Any
variation in formatting will cause gfi to reject the value.

`rfc2822`::
	This is the standard email format as described by RFC 2822.
+
An example value is ``Tue Feb 6 11:22:18 2007 -0500''.  The Git
parser is accurate, but a little on the lenient side.  Its the
same parser used by gitlink:git-am[1] when applying patches
received from email.
+
Some malformed strings may be accepted as valid dates.  In some of
these cases Git will still be able to obtain the correct date from
the malformed string.  There are also some types of malformed
strings which Git will parse wrong, and yet consider valid.
Seriously malformed strings will be rejected.
+
Unlike the `raw` format above, the timezone/UTC offset information
contained in an RFC 2822 date string is used to adjust the date
value to UTC prior to storage.  Therefore it is important that
this information be as accurate as possible.
+
If the source material is formatted in RFC 2822 style dates,
the frontend should let gfi handle the parsing and conversion
(rather than attempting to do it itself) as the Git parser has
been well tested in the wild.
+
Frontends should prefer the `raw` format if the source material
is already in UNIX-epoch format, or is easily convertible to
that format, as there is no ambiguity in parsing.

`now`::
	Always use the current time and timezone.  The literal
	`now` must always be supplied for `<when>`.
+
This is a toy format.  The current time and timezone of this system
is always copied into the identity string at the time it is being
created by gfi.  There is no way to specify a different time or
timezone.
+
This particular format is supplied as its short to implement and
may be useful to a process that wants to create a new commit
right now, without needing to use a working directory or
gitlink:git-update-index[1].
+
If separate `author` and `committer` commands are used in a `commit`
the timestamps may not match, as the system clock will be polled
twice (once for each command).  The only way to ensure that both
author and committer identity information has the same timestamp
is to omit `author` (thus copying from `committer`) or to use a
date format other than `now`.

  reply	other threads:[~2007-02-07  5:54 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         ` git-fast-import Linus Torvalds
2007-02-07  5:53           ` Shawn O. Pearce [this message]
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=20070207055352.GB7138@spearce.org \
    --to=spearce@spearce.org \
    --cc=andyparkins@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.