git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Teach git-describe to display distances from tags.
@ 2007-01-25 17:39 Shawn O. Pearce
  2007-01-25 21:26 ` Junio C Hamano
  2007-01-26 13:33 ` [PATCH 1/2] Teach git-describe to display distances from tags Jakub Narebski
  0 siblings, 2 replies; 15+ messages in thread
From: Shawn O. Pearce @ 2007-01-25 17:39 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Junio C Hamano <junkio@cox.net>:
> However, I suspect that we could do better with Shawn's new
> fangled describe implementation that actually counts the
> distance between what is described and the tag.  We could add
> "number of commits since the tag" somewhere, to describe:
>
>   v2.6.20-rc5-256-g419dd83
>   v2.6.20-rc5-217-gde14569
>
> to say that the first one has 256 commits accumulated since the
> given tag "v2.6.20-rc5" and the second one has only 217
> commits, to get the sense of how busy the development activity
> is.
>
> Is it useful?  That is something I am not sure.

Yes, its very useful.  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.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 builtin-describe.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/builtin-describe.c b/builtin-describe.c
index e7b8f95..d8ff621 100644
--- a/builtin-describe.c
+++ b/builtin-describe.c
@@ -189,7 +189,8 @@ static void describe(const char *arg, int last_one)
 				sha1_to_hex(gave_up_on->object.sha1));
 		}
 	}
-	printf("%s-g%s\n", all_matches[0].name->path,
+	printf("%s-%i-g%s\n", all_matches[0].name->path,
+		   all_matches[0].depth,
 		   find_unique_abbrev(cmit->object.sha1, abbrev));
 
 	if (!last_one)
-- 
1.5.0.rc2.g18af

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2007-01-26 19:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-25 17:39 [PATCH 1/2] Teach git-describe to display distances from tags Shawn O. Pearce
2007-01-25 21:26 ` Junio C Hamano
2007-01-25 21:37   ` Shawn O. Pearce
2007-01-25 21:42   ` Junio C Hamano
2007-01-25 21:49     ` Shawn O. Pearce
2007-01-25 23:32       ` Nicolas Pitre
2007-01-26  0:13         ` Junio C Hamano
2007-01-26  8:52           ` Francis Moreau
2007-01-26  9:00             ` Junio C Hamano
2007-01-26  9:39               ` Francis Moreau
2007-01-26  9:51                 ` Shawn O. Pearce
2007-01-26 10:36           ` Andy Parkins
2007-01-26 14:28             ` [PATCH] If abbrev is set to zero in git-describe, don't add the unique suffix Andy Parkins
2007-01-26 13:33 ` [PATCH 1/2] Teach git-describe to display distances from tags Jakub Narebski
2007-01-26 19:37   ` Matthias Lederhofer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).