From: Andrew Gallagher Date: Tue, 7 Jun 2011 03:57:04 +0000 (-0700) Subject: arc amend: fix failure when amending merge commit X-Git-Tag: conduit-4~319 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=ffbc7aae62c308cf1f22811474dac1d7c676ae8c;p=arcanist.git arc amend: fix failure when amending merge commit Summary: The amend process used "git log HEAD^..HEAD" to get log for the commit being amended. When run on a merge commit this can return any number of commits from the non-first parents. Since only a single commit was expected, arc fails here. This diff changes the amend process to use the '--first-parent' flag to be consistent with using '^', which references the first parent. This should guarantee a single commit log every time. Test Plan: arc amend on a merge commit Reviewed By: epriestley Reviewers: epriestley, jungejason CC: aran, epriestley, andrewjcg Differential Revision: 415 --- diff --git a/src/repository/api/git/ArcanistGitAPI.php b/src/repository/api/git/ArcanistGitAPI.php index 1df02444..baedd1e6 100644 --- a/src/repository/api/git/ArcanistGitAPI.php +++ b/src/repository/api/git/ArcanistGitAPI.php @@ -137,7 +137,7 @@ class ArcanistGitAPI extends ArcanistRepositoryAPI { $this->getPath()); } else { list($stdout) = execx( - '(cd %s; git log --format=medium %s..HEAD)', + '(cd %s; git log --first-parent --format=medium %s..HEAD)', $this->getPath(), $this->getRelativeCommit()); }