Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
diff: diff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value
author
Ann T Ropea
<bedhanger@gmx.de>
Sun, 3 Dec 2017 21:27:42 +0000
(22:27 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 6 Dec 2017 15:32:59 +0000
(07:32 -0800)
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>
diff.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
b4c02c3
)
diff --git
a/diff.c
b/diff.c
index e6814b9e9c6d6f49a48fb2d3234323e20dec5f56..8c2bf97cb71fc4ab76329836242e4d131b82a266 100644
(file)
--- 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;
int abblen;
const char *abbrev;
+ /* Do we want all 40 hex characters? */
if (len == GIT_SHA1_HEXSZ)
return oid_to_hex(oid);
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);
abbrev = diff_abbrev_oid(oid, len);
+
+ if (!print_sha1_ellipsis())
+ return abbrev;
+
abblen = strlen(abbrev);
/*
abblen = strlen(abbrev);
/*
- * In well-behaved cases, where the abb
b
reviated 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
* 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