Page MenuHomePhabricator

Survive hand-crafted Git commits which are missing timestamp information
ClosedPublic

Authored by epriestley on Jan 4 2017, 3:45 PM.
Tags
None
Referenced Files
F13999988: D17136.id41210.diff
Thu, Oct 24, 6:36 PM
F13967838: D17136.id.diff
Oct 16 2024, 4:21 PM
Unknown Object (File)
Sep 27 2024, 4:36 PM
Unknown Object (File)
Sep 24 2024, 6:32 AM
Unknown Object (File)
Sep 19 2024, 4:06 PM
Unknown Object (File)
Sep 4 2024, 5:56 AM
Unknown Object (File)
Sep 2 2024, 9:25 PM
Unknown Object (File)
Aug 27 2024, 8:02 PM
Subscribers
None

Details

Summary

Fixes T12062. Like the commits from the year 3500, you can artificially build commits with no date information.

We could explicitly store these as null to fully respect the underlying datastore. However, I think it's very unlikely that these commits are intentional/meaningful or that this is valuable.

Additionally, "git show" interprets these commits as "Jan 1, 1970". Just store a 0 to mimic its behavior.

Test Plan
  • Following the process in T11537#192019, artificially created a commit with no date information (I deleted all date information from the message).
  • Used git show / git log --format ... to inspect it: "Jan 1, 1970" on git show, no information at all on %aD, %aT, etc.
  • Pushed it.
  • Saw exception for trying to insert empty string into epoch colum from bin/repository update.
  • Applied patch.
  • Got a clean import.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable