From: Junio C Hamano Date: Tue, 27 Dec 2005 22:49:22 +0000 (-0800) Subject: git-describe: use find_unique_abbrev() X-Git-Tag: v1.1.0~20 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=4cdf78bf964912698ab33579977f21a3e0b832ed;p=git.git git-describe: use find_unique_abbrev() Just in case 8 hexadecimal digits are not enough. We could use shorter default if we wanted to. Signed-off-by: Junio C Hamano --- diff --git a/describe.c b/describe.c index e1b6588c..ba49d002 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; } }