From 8c78cde32f5e3c4db2fcd62c50ffae974c108e9a Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 20 Apr 2018 13:09:47 -0700 Subject: [PATCH] Stop "git blame" from printing "^" markers on root repository commits Summary: Depends on D19391. Ref T13126. See that task for some details on what's going on here. Test Plan: - Viewed a file which includes lines that were added during the first commit to the repository. - Before D19391: fatal. - After D19391: blank. - After this patch: accurate blame information. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13126 Differential Revision: https://secure.phabricator.com/D19392 --- .../diffusion/query/blame/DiffusionGitBlameQuery.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/applications/diffusion/query/blame/DiffusionGitBlameQuery.php b/src/applications/diffusion/query/blame/DiffusionGitBlameQuery.php index f98cc645a7..0eb15cd018 100644 --- a/src/applications/diffusion/query/blame/DiffusionGitBlameQuery.php +++ b/src/applications/diffusion/query/blame/DiffusionGitBlameQuery.php @@ -7,8 +7,12 @@ final class DiffusionGitBlameQuery extends DiffusionBlameQuery { $commit = $request->getCommit(); + // NOTE: The "--root" flag suppresses the addition of the "^" boundary + // commit marker. Without it, root commits render with a "^" before them, + // and one fewer character of the commit hash. + return $repository->getLocalCommandFuture( - '--no-pager blame -s -l %s -- %s', + '--no-pager blame --root -s -l %s -- %s', $commit, $path); }