1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-18 09:48:39 +01:00

Use committer date instead of author date for Git epoch

Summary:
This is somewhat controversial but push date is usually more useful than commit date (which can be for example a month before other people can see the commit).
We can also store both dates.

Test Plan:
  git log --pretty="%ct %at"

Reviewers: epriestley

Reviewed By: epriestley

CC: nh, aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2319
This commit is contained in:
vrana 2012-04-25 20:02:11 -07:00
parent a0417d97c8
commit 38ffe45f8e
3 changed files with 2 additions and 13 deletions

View file

@ -119,7 +119,7 @@ final class PhabricatorRepositoryGitCommitDiscoveryDaemon
while (true) { while (true) {
$target = array_pop($insert); $target = array_pop($insert);
list($epoch) = $repository->execxLocalCommand( list($epoch) = $repository->execxLocalCommand(
'log -n1 --pretty="%%at" %s', 'log -n1 --pretty="%%ct" %s',
$target); $target);
$epoch = trim($epoch); $epoch = trim($epoch);

View file

@ -96,10 +96,7 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
if ($revision->getStatus() != if ($revision->getStatus() !=
ArcanistDifferentialRevisionStatus::CLOSED) { ArcanistDifferentialRevisionStatus::CLOSED) {
$date_committed = $this->getDateCommitted($commit); $revision->setDateCommitted($commit->getEpoch());
if ($date_committed) {
$revision->setDateCommitted($date_committed);
}
$message = null; $message = null;
$committer = $data->getCommitDetail('authorPHID'); $committer = $data->getCommitDetail('authorPHID');
@ -118,10 +115,6 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
} }
} }
protected function getDateCommitted(PhabricatorRepositoryCommit $commit) {
return null;
}
/** /**
* When querying for revisions by hash, more than one revision may be found. * When querying for revisions by hash, more than one revision may be found.
* This function identifies the "best" revision from such a set. Typically, * This function identifies the "best" revision from such a set. Typically,

View file

@ -54,8 +54,4 @@ final class PhabricatorRepositorySvnCommitMessageParserWorker
return array(); return array();
} }
protected function getDateCommitted(PhabricatorRepositoryCommit $commit) {
return $commit->getEpoch();
}
} }