mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-30 02:32:42 +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:
parent
260b40b84a
commit
2f96095014
1 changed files with 4 additions and 2 deletions
|
@ -25,17 +25,19 @@ class PhabricatorRepositoryGitCommitMessageParserWorker
|
||||||
|
|
||||||
$local_path = $repository->getDetail('local-path');
|
$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(
|
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,
|
$local_path,
|
||||||
$commit->getCommitIdentifier());
|
$commit->getCommitIdentifier());
|
||||||
|
|
||||||
|
|
||||||
list($author, $message) = explode("\0", $info);
|
list($author, $message) = explode("\0", $info);
|
||||||
|
|
||||||
// Make sure these are valid UTF-8.
|
// Make sure these are valid UTF-8.
|
||||||
$author = phutil_utf8ize($author);
|
$author = phutil_utf8ize($author);
|
||||||
$message = phutil_utf8ize($message);
|
$message = phutil_utf8ize($message);
|
||||||
|
$message = trim($message);
|
||||||
|
|
||||||
$this->updateCommitData($author, $message);
|
$this->updateCommitData($author, $message);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue