1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 18:22:41 +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) {
$target = array_pop($insert);
list($epoch) = $repository->execxLocalCommand(
'log -n1 --pretty="%%at" %s',
'log -n1 --pretty="%%ct" %s',
$target);
$epoch = trim($epoch);

View file

@ -96,10 +96,7 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
if ($revision->getStatus() !=
ArcanistDifferentialRevisionStatus::CLOSED) {
$date_committed = $this->getDateCommitted($commit);
if ($date_committed) {
$revision->setDateCommitted($date_committed);
}
$revision->setDateCommitted($commit->getEpoch());
$message = null;
$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.
* This function identifies the "best" revision from such a set. Typically,

View file

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