@matheusbsbs / matheus-bagliano / commits / 4cdf78bf96
Fork 0

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 <junkio@cox.net>

Junio C Hamano committed Dec 27, 2005 at 14:49 UTC 4cdf78bf964912698ab33579977f21a3e0b832ed
1 file changed +2 -1
describe.c
+2 -1
@@ -95,7 +95,8 @@ static void describe(struct commit *cmit)
95 struct commit *c = pop_most_recent_commit(&list, SEEN);
96 n = match(c);
97 if (n) {
98 - printf("%s-g%.8s\n", n->path, sha1_to_hex(cmit->object.sha1));
98 + printf("%s-g%s\n", n->path,
99 + find_unique_abbrev(cmit->object.sha1, 8));
100 return;
101 }
102 }