summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorAnn T Ropea <bedhanger@gmx.de>2017-12-03 21:27:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-12-06 15:32:59 (GMT)
commit7cb6ac1e4b5c58b515ca503c972124e8b5a0d9ee (patch)
treee3dd5c1ad8b8b7a1f9013de9313cb9718fb9b9ce /diff.c
parentb4c02c3008e2ebe8f214c44889d22cfc46252b60 (diff)
downloadgit-7cb6ac1e4b5c58b515ca503c972124e8b5a0d9ee.zip
git-7cb6ac1e4b5c58b515ca503c972124e8b5a0d9ee.tar.gz
git-7cb6ac1e4b5c58b515ca503c972124e8b5a0d9ee.tar.bz2
diff: diff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value
Neither Git nor the user are in need of this (visual) aid anymore, but we must offer a transition period. A follow-up patch (series) will rectify the situation by covering the new output format as well as the backward compatible one. Also, fix a typo: "abbbreviated" ---> "abbreviated". Signed-off-by: Ann T Ropea <bedhanger@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index e6814b9..8c2bf97 100644
--- a/diff.c
+++ b/diff.c
@@ -4903,14 +4903,20 @@ const char *diff_aligned_abbrev(const struct object_id *oid, int len)
int abblen;
const char *abbrev;
+ /* Do we want all 40 hex characters? */
if (len == GIT_SHA1_HEXSZ)
return oid_to_hex(oid);
+ /* An abbreviated value is fine, possibly followed by an ellipsis. */
abbrev = diff_abbrev_oid(oid, len);
+
+ if (!print_sha1_ellipsis())
+ return abbrev;
+
abblen = strlen(abbrev);
/*
- * In well-behaved cases, where the abbbreviated result is the
+ * In well-behaved cases, where the abbreviated result is the
* same as the requested length, append three dots after the
* abbreviation (hence the whole logic is limited to the case
* where abblen < 37); when the actual abbreviated result is a