1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 14:52:40 +01:00

Explicitly use "--format=medium" when running 'git log'

Summary:
Git (the world's hardest revision control system) allows you to change
output formats by accident and/or without your direct knowledge. Protect users
from themselves.

Test Plan:
Changed "pretty" in [format] to "format:quack" so every log just
outputs the word "quack". Ran "arc diff" successfully.

Reviewed By: aran
Reviewers: aran
CC: epriestley, aran
Differential Revision: 56
This commit is contained in:
epriestley 2011-03-07 15:37:38 -08:00
parent 4b30319747
commit 71016a09f8

View file

@ -119,11 +119,11 @@ class ArcanistGitAPI extends ArcanistRepositoryAPI {
$relative = $this->getRelativeCommit(); $relative = $this->getRelativeCommit();
if ($relative == self::GIT_MAGIC_ROOT_COMMIT) { if ($relative == self::GIT_MAGIC_ROOT_COMMIT) {
list($stdout) = execx( list($stdout) = execx(
'(cd %s; git log HEAD)', '(cd %s; git log --format=medium HEAD)',
$this->getPath()); $this->getPath());
} else { } else {
list($stdout) = execx( list($stdout) = execx(
'(cd %s; git log %s..HEAD)', '(cd %s; git log --format=medium %s..HEAD)',
$this->getPath(), $this->getPath(),
$this->getRelativeCommit()); $this->getRelativeCommit());
} }
@ -132,7 +132,7 @@ class ArcanistGitAPI extends ArcanistRepositoryAPI {
public function getGitHistoryLog() { public function getGitHistoryLog() {
list($stdout) = execx( list($stdout) = execx(
'(cd %s; git log -n%d %s)', '(cd %s; git log --format=medium -n%d %s)',
$this->getPath(), $this->getPath(),
self::SEARCH_LENGTH_FOR_PARENT_REVISIONS, self::SEARCH_LENGTH_FOR_PARENT_REVISIONS,
$this->getRelativeCommit()); $this->getRelativeCommit());