[PATCH 2/6] git-describe: use find_unique_abbrev()
- From
Junio C Hamano <junkio@cox.net>
- Date
- Dec 28, 2005, 00:42 UTC
- Message-ID
- <7vvexa2gsw.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.64.0512241409300.14098@g5.osdl.org>
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>
---
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