summaryrefslogtreecommitdiff
path: root/describe.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-12-27 22:49:22 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-12-28 01:57:27 (GMT)
commit4cdf78bf964912698ab33579977f21a3e0b832ed (patch)
tree6fe9005fe827971156bd076cf4f8b097f52c673b /describe.c
parent635d413430d5419cfd0ac18e2318cf46c1984750 (diff)
downloadgit-4cdf78bf964912698ab33579977f21a3e0b832ed.zip
git-4cdf78bf964912698ab33579977f21a3e0b832ed.tar.gz
git-4cdf78bf964912698ab33579977f21a3e0b832ed.tar.bz2
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>
Diffstat (limited to 'describe.c')
-rw-r--r--describe.c3
1 files changed, 2 insertions, 1 deletions
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;
}
}