[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