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

Patching Git to handle dates before the Unix epoch

From
Diomidis Spinellis <dds@aueb.gr>
Date
Sep 10, 2019, 14:14 UTC
Message-ID
<c12e3505-7a02-3eaf-7d71-57a3b4df28d1@aueb.gr>

As people use Git to create synthetic commits of code written in the past [1,2] it becomes important to handle dates before the Unix epoch (1/1/1970). I see that modern C libraries, Unix kernels, and tools can handle such dates. However Git seems to mishandle such dates in several places, such as in date.c [3,4]. I'm planning to work on a fix, but before I embark on this I have a few questions.

- Do you see any reasons that may prevent the acceptance of such a patch?
- Can you think of any non-obvious issues (e.g. backward compatibility, 
switch to the Gregorian calendar) I should be aware of?
- Should I submit changes as a bug fix on the maint branch or as a new 
feature on master?

[1] https://github.com/dspinellis/unix-history-repo (original dates) [2] https://github.com/chrislgarry/Apollo-11 (wrong dates) [3] https://github.com/git/git/blob/master/date.c#L21 [4] https://github.com/git/git/blob/master/date.c#L776

Diomidis Spinellis - https://www.spinellis.gr
Next: Randall S. Becker
Message 1 of 6 in “Patching Git to handle dates before the Unix epoch”
  1. Diomidis SpinellisSep 10, 2019
  2. Randall S. BeckerSep 10, 2019
  3. Jeff KingSep 10, 2019
  4. Jeff KingSep 10, 2019
  5. Diomidis SpinellisSep 10, 2019
  6. Jeff KingSep 13, 2019

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.