diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2007-01-25 12:39:54 -0500 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-01-28 02:08:51 -0800 |
commit | 237fb6ca7cbe45f88523ad367d0d703a039dff2d (patch) | |
tree | 4dfdc4b03eb64ce8003868dc584514a412799bb6 /builtin-describe.c | |
parent | 46e5e69d5f2e8ae87a29953531a3d1bd7cb0292f (diff) | |
download | git-237fb6ca7cbe45f88523ad367d0d703a039dff2d.tar.gz git-237fb6ca7cbe45f88523ad367d0d703a039dff2d.tar.xz |
Teach git-describe to display distances from tags.
If you get two different describes at different
times from a non-rewinding branch and they both come up with the same
tag name, you can tell which is the 'newer' one by distance. This is
rather common in practice, so its incredibly useful.
[jc: still needs documentation and fixups when traversal gives up
early.]
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-describe.c')
-rw-r--r-- | builtin-describe.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin-describe.c b/builtin-describe.c index f3ac2d5f8..aedbc78da 100644 --- a/builtin-describe.c +++ b/builtin-describe.c @@ -191,8 +191,9 @@ static void describe(const char *arg, int last_one) if (abbrev == 0) printf("%s\n", all_matches[0].name->path ); else - printf("%s-g%s\n", all_matches[0].name->path, - find_unique_abbrev(cmit->object.sha1, abbrev)); + printf("%s-%d-g%s\n", all_matches[0].name->path, + all_matches[0].depth, + find_unique_abbrev(cmit->object.sha1, abbrev)); if (!last_one) clear_commit_marks(cmit, -1); |