summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-12-19 19:33:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-12-19 19:33:58 (GMT)
commit8d7fefaac4318ac3155368f475e10f97714ebd47 (patch)
tree225f9c262ffa4d1bcd58a2b407df396594a711cb /builtin
parent66d3f19324ac9eeae8ef0d2ae2067ae7b18f8ac8 (diff)
parent64a5e98032d2462749021136a53d9e1928cd0db0 (diff)
downloadgit-8d7fefaac4318ac3155368f475e10f97714ebd47.zip
git-8d7fefaac4318ac3155368f475e10f97714ebd47.tar.gz
git-8d7fefaac4318ac3155368f475e10f97714ebd47.tar.bz2
Merge branch 'ar/unconfuse-three-dots'
Ancient part of codebase still shows dots after an abbreviated object name just to show that it is not a full object name, but these ellipses are confusing to people who newly discovered Git who are used to seeing abbreviated object names and find them confusing with the range syntax. * ar/unconfuse-three-dots: t2020: test variations that matter t4013: test new output from diff --abbrev --raw diff: diff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value t4013: prepare for upcoming "diff --raw --abbrev" output format change checkout: describe_detached_head: remove ellipsis after committish print_sha1_ellipsis: introduce helper Documentation: user-manual: limit usage of ellipsis Documentation: revisions: fix typo: "three dot" ---> "three-dot" (in line with "two-dot").
Diffstat (limited to 'builtin')
-rw-r--r--builtin/checkout.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 9b88635..f9f3797 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -401,10 +401,16 @@ static void show_local_changes(struct object *head,
static void describe_detached_head(const char *msg, struct commit *commit)
{
struct strbuf sb = STRBUF_INIT;
+
if (!parse_commit(commit))
pp_commit_easy(CMIT_FMT_ONELINE, commit, &sb);
- fprintf(stderr, "%s %s... %s\n", msg,
- find_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);
+ if (print_sha1_ellipsis()) {
+ fprintf(stderr, "%s %s... %s\n", msg,
+ find_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);
+ } else {
+ fprintf(stderr, "%s %s %s\n", msg,
+ find_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);
+ }
strbuf_release(&sb);
}