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

Re: Is there way to set git commit --date to be older than 1970 ?

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 30, 2014, 17:24 UTC
Message-ID
<xmqqr3xpwjvj.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAOE_JxJp0nA_p_42yOyk_nMjsyMaovj0Fx6AJ5nywiEQfB5XAQ@mail.gmail.com>
Peter Vojtek <peter.vojtek@gmail.com> writes:
> It seems the commit date can be between 1970 and 2100 (on my 32bit
> linux), however man git (section DATE FORMATS) claims ISO 8601
> standard is supported.

The date formats section of "git log" only talks about the output format (I do not see in "man git" any section about date formats, by the way), once Git understands and records the timestamp in its internal representation (which is "seconds since the epoch"; as I already said, theoretically it should be possible to record negative number of seconds there, the current code does not allow it).

The documentation may need to be clarified, independent from what the implementation does on the input side. The current text from "git log" reads like so:

       --date=(relative|local|default|iso|iso-strict|rfc|short|raw)
           Only takes effect for dates shown in human-readable
           format, such as when using --pretty.  log.date config
           variable sets a default value for the log command’s
           --date option.

The word "shown" is meant to stress that this description is about output side, but apparently it was misread as if somehow a user can affect the input by giving --date=iso or something, so perhaps you would want to suggest a better phrasing?

Thanks.
Previous: Junio C Hamano
Message 9 of 9 in “Is there way to set git commit --date to be older than 1970 ?”
  1. Peter VojtekOct 29, 2014
  2. Fredrik GustafssonOct 29, 2014
  3. Peter VojtekOct 29, 2014
  4. Junio C HamanoOct 29, 2014
  5. Roberto Eduardo Decurnex GorositoOct 29, 2014
  6. Dan JohnsonOct 30, 2014
  7. Jeff KingOct 30, 2014
  8. Junio C HamanoOct 30, 2014
  9. Junio C HamanoOct 30, 2014

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.