@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Survive hand-crafted Git commits which are missing timestamp information

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.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12062

Differential Revision: https://secure.phabricator.com/D17136

+7
+7
src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php
··· 414 414 $epoch = PhabricatorTime::getNow(); 415 415 } 416 416 417 + // If the epoch is not present at all, treat it as though it stores the 418 + // value "0". For discussion, see T12062. This behavior is consistent 419 + // with the behavior of "git show". 420 + if (!strlen($epoch)) { 421 + $epoch = 0; 422 + } 423 + 417 424 $refs[] = id(new PhabricatorRepositoryCommitRef()) 418 425 ->setIdentifier($commit) 419 426 ->setEpoch($epoch)