git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git describe weird behaviour

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Nov 10, 2010, 20:40 UTC
Message-ID
<20101110204034.GO22105@genesis.frugalware.org>
In-Reply-To
<7vaalhhstp.fsf@alter.siamese.dyndns.org>
On Wed, Nov 10, 2010 at 11:38:58AM -0800, Junio C Hamano <gitster@pobox.com> wrote:
> Just a guess.  Does this have to do with 80dbae0 (Chose better tag names
> in git-describe after merges., 2007-01-10)?

Hmm, not sure. I tried reverting that commit, but that resulted in conflicts - git checkout 80dbae0^ produces a git binary that can't read the index version we have today. :)

But I think the approach to follow the first parent only would solve the problem outlined in the commit message of 80dbae0 as well: I think it's pretty rare to tag a commit in a feature branch, then merge it.

I mean the trivial proof of concenpt below finds the right tag here:

$ ~/git/git/git describe 1.4pre1-572-g42b497b

Even if it does not count all the commits since that tag:

$ git rev-list 1.4pre1..|wc -l 883

Thanks.
diff --git a/builtin/describe.c b/builtin/describe.c
index 43caff2..f32eaf4 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -303,6 +303,7 @@ static void describe(const char *arg, int last_one)
 				insert_by_date(p, &list);
 			p->object.flags |= c->object.flags;
 			parents = parents->next;
+			break;
 		}
 	}
 
Previous: Junio C HamanoNext: Jonathan Nieder
Message 9 of 11 in “git describe weird behaviour”
  1. Miklos VajnaNov 10, 2010
  2. Jeff KingNov 10, 2010
  3. MaaartinNov 10, 2010
  4. Thomas RastNov 10, 2010
  5. Miklos VajnaNov 10, 2010
  6. Miklos VajnaDec 9, 2010
  7. Jeff KingDec 9, 2010
  8. Junio C HamanoNov 10, 2010
  9. Miklos VajnaNov 10, 2010
  10. Jonathan NiederNov 10, 2010
  11. Miklos VajnaNov 10, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.