Thread (11 messages) flat view 11 messages, 4 authors, 2016-06-15
DORMANTno replies

[PATCH 2/6] git-describe: use find_unique_abbrev()

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:15
Subsystem: the rest · Maintainer: Linus Torvalds

Just in case 8 hexadecimal digits are not enough.  We could use
shorter default if we wanted to.

Signed-off-by: Junio C Hamano <redacted>

---

 describe.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

298f9203cf85d5de28a8380bd26f85206530b7d0
diff --git a/describe.c b/describe.c
index e1b6588..ba49d00 100644
--- a/describe.c
+++ b/describe.c
@@ -95,7 +95,8 @@ static void describe(struct commit *cmit
 		struct commit *c = pop_most_recent_commit(&list, SEEN);
 		n = match(c);
 		if (n) {
-			printf("%s-g%.8s\n", n->path, sha1_to_hex(cmit->object.sha1));
+			printf("%s-g%s\n", n->path,
+			       find_unique_abbrev(cmit->object.sha1, 8));
 			return;
 		}
 	}
-- 
1.0.5-geb9d
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help