Page MenuHomePhabricator

Survive import of artificially manufactured Git commits with no timestamps
Closed, ResolvedPublic

Description

See T11537 for the previous adventure.

This time, the commit appears to have no commit date (epoch 0).

This is probably a ! which should be a strlen() somewhere, or something like that.

Event Timeline

I believe this reproduces by following the steps in T11537#192019, but deleting all timestamp information completely.

This produces commits with no timestamp information (first commit, here):

$ git log -n 3 --format='author-date<%aD / %at> committer-date<%cD / %ct>'
author-date< / > committer-date< / >
author-date<Wed, 21 Dec 2016 13:22:33 -0800 / 1482355353> committer-date<Sun, 1 Jan 2017 08:52:44 -0800 / 1483289564>
author-date<Mon, 5 Dec 2016 12:00:05 -0800 / 1480968005> committer-date<Mon, 5 Dec 2016 12:00:05 -0800 / 1480968005>

Although git show shows a Jan 1, 1970 date, the raw --format options show no date data.

This appears to reproduce the issue when pushed:

$ ./bin/repository update locktopia
[2017-01-04 09:14:40] EXCEPTION: (AphrontQueryException) #1366: Incorrect integer value: '' for column 'epoch' at row 1 at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:355]
...