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
Roberto Eduardo Decurnex Gorosito <decurnex.roberto@gmail.com>
Date
Oct 29, 2014, 20:03 UTC
Message-ID
<CABj5xzcigToDam4JGG9POkaZPh8V=ptEW_F8AO621HA0vCqM8A@mail.gmail.com>
In-Reply-To
<xmqqh9ymy8np.fsf@gitster.dls.corp.google.com>
Peter,
You should be happy of getting the error message.
 Since Git 2 invalid years will default to the current year (keeping
the given day and month) without warnings.

-- Roberto Decurnex

On Wed, Oct 29, 2014 at 4:31 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 24 quoted lines
> Peter Vojtek <peter.vojtek@gmail.com> writes:
>
>> It seems the commit date can be between 1970 and 2100 (on my 32bit
>> linux),...
>
> The underlying data representation records time as number of seconds
> since epoch (1970-01-01).  Theoretically the codepaths that read
> data could consider negative timestamps to represent times before
> the epoch, but in the context of source code control, negative
> values are more likely to be an indication of a bug or a user
> mistake, and I do not think any existing code in Git is prepared to
> pass such a timestamp as a sane value---instead they diagnose a
> failure and die.
>
>> I understand that this is rather an esoteric use case :)
>
> Yeah, this is pretty much outside of what we intend to support.
>
> Thanks.
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Junio C HamanoNext: Dan Johnson
Message 5 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.