]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Explicitly use "--format=medium" when running 'git log'
authorepriestley <epriestley@phabricator.com>
Mon, 7 Mar 2011 23:37:38 +0000 (15:37 -0800)
committerepriestley <epriestley@phabricator.com>
Tue, 8 Mar 2011 00:13:06 +0000 (16:13 -0800)
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

src/repository/api/git/ArcanistGitAPI.php

index 8d9206710d1d70a8afda491d57e363746231e387..15f5c952b62426cdc777fb72efd83bee4ffab0d3 100644 (file)
@@ -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());