summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b66fde9)
raw | patch | inline | side by side (parent: b66fde9)
author | Junio C Hamano <gitster@pobox.com> | |
Sun, 2 Mar 2008 07:43:32 +0000 (23:43 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 2 Mar 2008 07:52:13 +0000 (23:52 -0800) |
Now find_unique_abbrev() never returns NULL, there is no need for callers
to prepare for seeing NULL and fall back to giving the full 40-hexdigits.
While we are at it, drop "..." in the "git reset" output that reports the
location of the new HEAD, between the abbreviated commit object name and
the one line commit summary. Because we are always showing the HEAD
(which cannot be missing!), we never had a case where we show the full 40
hexdigits that is not followed by three dots, and these three dots were
stealing 3 columns from the precious horizontal screen real estate out of
80 that can better be used for the one line commit summary.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
to prepare for seeing NULL and fall back to giving the full 40-hexdigits.
While we are at it, drop "..." in the "git reset" output that reports the
location of the new HEAD, between the abbreviated commit object name and
the one line commit summary. Because we are always showing the HEAD
(which cannot be missing!), we never had a case where we show the full 40
hexdigits that is not followed by three dots, and these three dots were
stealing 3 columns from the precious horizontal screen real estate out of
80 that can better be used for the one line commit summary.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-reset.c | patch | blob | history | |
builtin-send-pack.c | patch | blob | history | |
diff.c | patch | blob | history |
diff --git a/builtin-reset.c b/builtin-reset.c
index af0037ec6e3456ccd688da6375c76db4a59f099a..bb3e19240a8921126600cddd70ac46b3b1bada29 100644 (file)
--- a/builtin-reset.c
+++ b/builtin-reset.c
static void print_new_head_line(struct commit *commit)
{
- const char *hex, *dots = "...", *body;
+ const char *hex, *body;
hex = find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV);
- if (!hex) {
- hex = sha1_to_hex(commit->object.sha1);
- dots = "";
- }
- printf("HEAD is now at %s%s", hex, dots);
+ printf("HEAD is now at %s", hex);
body = strstr(commit->buffer, "\n\n");
if (body) {
const char *eol;
diff --git a/builtin-send-pack.c b/builtin-send-pack.c
index b0cfae83fc4dcdd8f58e29b87fd8aa4b6af0f6c0..930e0fb3fdfee2293d0fca650d7139f09f2d381e 100644 (file)
--- a/builtin-send-pack.c
+++ b/builtin-send-pack.c
@@ -264,9 +264,7 @@ static void print_ref_status(char flag, const char *summary, struct ref *to, str
static const char *status_abbrev(unsigned char sha1[20])
{
- const char *abbrev;
- abbrev = find_unique_abbrev(sha1, DEFAULT_ABBREV);
- return abbrev ? abbrev : sha1_to_hex(sha1);
+ return find_unique_abbrev(sha1, DEFAULT_ABBREV);
}
static void print_ok_ref_status(struct ref *ref)
index ad16164232f22207c2aa52c3b8c6ed4dcc3067b1..b80f656fb96cc2bfaa2bd1a8eedd0ee412363bd7 100644 (file)
--- a/diff.c
+++ b/diff.c
return sha1_to_hex(sha1);
abbrev = find_unique_abbrev(sha1, len);
- if (!abbrev)
- return sha1_to_hex(sha1);
abblen = strlen(abbrev);
if (abblen < 37) {
static char hex[41];