1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Use %s and %b in GitCommitMessageParserWorker, not %B

Summary:
See T129, some older git doesn't have %B and we can reasonably fake it with %s
and %b.

Test Plan:
Reparsed all of the Phabricator repository with this worker, commit messages
look fine.

Reviewed By: rm
Reviewers: rm, aran, jungejason, tuomaspelkonen
CC: aran, rm
Differential Revision: 209
This commit is contained in:
epriestley 2011-05-02 01:06:38 -07:00
parent 260b40b84a
commit 2f96095014

View file

@ -25,17 +25,19 @@ class PhabricatorRepositoryGitCommitMessageParserWorker
$local_path = $repository->getDetail('local-path');
// NOTE: %B was introduced somewhat recently in git's history, so pull
// commit message information with %s and %b instead.
list($info) = execx(
'(cd %s && git log -n 1 --pretty=format:%%an%%x00%%B %s)',
'(cd %s && git log -n 1 --pretty=format:%%an%%x00%%s%%n%%n%%b %s)',
$local_path,
$commit->getCommitIdentifier());
list($author, $message) = explode("\0", $info);
// Make sure these are valid UTF-8.
$author = phutil_utf8ize($author);
$message = phutil_utf8ize($message);
$message = trim($message);
$this->updateCommitData($author, $message);