Skip to content

Commit 7cb6ac1

Browse files
bedhangergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b4c02c3 commit 7cb6ac1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

diff.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4903,14 +4903,20 @@ const char *diff_aligned_abbrev(const struct object_id *oid, int len)
49034903
int abblen;
49044904
const char *abbrev;
49054905

4906+
/* Do we want all 40 hex characters? */
49064907
if (len == GIT_SHA1_HEXSZ)
49074908
return oid_to_hex(oid);
49084909

4910+
/* An abbreviated value is fine, possibly followed by an ellipsis. */
49094911
abbrev = diff_abbrev_oid(oid, len);
4912+
4913+
if (!print_sha1_ellipsis())
4914+
return abbrev;
4915+
49104916
abblen = strlen(abbrev);
49114917

49124918
/*
4913-
* In well-behaved cases, where the abbbreviated result is the
4919+
* In well-behaved cases, where the abbreviated result is the
49144920
* same as the requested length, append three dots after the
49154921
* abbreviation (hence the whole logic is limited to the case
49164922
* where abblen < 37); when the actual abbreviated result is a

0 commit comments

Comments
 (0)