From: epriestley Date: Mon, 7 Mar 2011 23:37:38 +0000 (-0800) Subject: Explicitly use "--format=medium" when running 'git log' X-Git-Tag: conduit-4~380 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=71016a09f80a42ceb38a566afc8f33a6d0a85eea;p=arcanist.git 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 --- diff --git a/src/repository/api/git/ArcanistGitAPI.php b/src/repository/api/git/ArcanistGitAPI.php index 8d920671..15f5c952 100644 --- a/src/repository/api/git/ArcanistGitAPI.php +++ b/src/repository/api/git/ArcanistGitAPI.php @@ -119,11 +119,11 @@ class ArcanistGitAPI extends ArcanistRepositoryAPI { $relative = $this->getRelativeCommit(); if ($relative == self::GIT_MAGIC_ROOT_COMMIT) { list($stdout) = execx( - '(cd %s; git log HEAD)', + '(cd %s; git log --format=medium HEAD)', $this->getPath()); } else { list($stdout) = execx( - '(cd %s; git log %s..HEAD)', + '(cd %s; git log --format=medium %s..HEAD)', $this->getPath(), $this->getRelativeCommit()); } @@ -132,7 +132,7 @@ class ArcanistGitAPI extends ArcanistRepositoryAPI { public function getGitHistoryLog() { list($stdout) = execx( - '(cd %s; git log -n%d %s)', + '(cd %s; git log --format=medium -n%d %s)', $this->getPath(), self::SEARCH_LENGTH_FOR_PARENT_REVISIONS, $this->getRelativeCommit());