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

[RFC/PATCH 0/2] Commits with ancient timestamps

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 2, 2012, 21:41 UTC
Message-ID
<1328218903-5681-1-git-send-email-gitster@pobox.com>

Result of conversion of ancient history from other SCMs, and output from other third-party tools, can record timestamps that predates inception of Git. They can cause "git am", "git rebase" and "git commit --amend" to misbehave, because the raw git timestamp e.g.

	author <a.u.thor@example.com> 1328214896 -0800

are read from the commit object and passed to parse_date() machinery, which rejects raw git timestamps without sufficient number of digits to avoid misinterpreting human-written timestamp in other formats, and timestamps before 1975 do not have enough number of digits in them.

Here is a two-patch series that may improve the situation.

Note that this is not meant for direct application, unless somebody uses this extensively to make sure there is no regression.

Junio C Hamano (2):
  parse_date(): allow ancient timestamps in in-header format
  parse_date(): '@' prefix forces git-timestamp interpretation
 date.c          |   30 ++++++++++++++++++++++++++++++
 git-sh-setup.sh |    2 +-
 2 files changed, 31 insertions(+), 1 deletions(-)
-- 
1.7.9.172.ge26ae
Next: Junio C Hamano
Message 1 of 6 in “Commits with ancient timestamps”
  1. 0/2 Commits with ancient timestampsJunio C Hamano, Feb 2, 2012
  2. 1/2 parse_date(): allow ancient git-timestampJunio C Hamano, Feb 2, 2012
  3. 2/2 parse_date(): '@' prefix forces git-timestampJunio C Hamano, Feb 2, 2012
  4. Thomas RastFeb 3, 2012
  5. Junio C HamanoFeb 3, 2012
  6. Han-Wen NienhuysFeb 3, 2012

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.