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

Re: Git describe question

From
MBMark Burton <markb@ordern.com>
Date
Jul 15, 2008, 06:40 UTC
Message-ID
<20080715074000.110b896e@crow>
In-Reply-To
<7v1w1wf42n.fsf@gitster.siamese.dyndns.org>

On Mon, 14 Jul 2008 16:17:52 -0700 Junio C Hamano <gitster@pobox.com> wrote:

Show 18 quoted lines
> Jean-Luc Herren <jlh@gmx.ch> writes:
> 
> > Mark Burton wrote:
> > ...
> > I don't think people usually say "tag X is on branch Y", excepted
> > maybe if Y has never been merged anywhere.  Specifically, nobody
> > would say v1.5.6.3 is *on* branch master.  But it's part of its
> > history.  v1.5.6.3 is *on* maint, at best.
> 
> Actually I am somewhat sympathetic to Mark here.  Probably what he wants
> is to describe 10ce020 as v1.5.6-390-10ce020.
> 
> While that probably is doable by using the first-parent-only traversal, I
> do not think it is such a good idea.  It is not how branches in git are
> designed to work.  As Merlyn always says in #git at freenode, a branch is
> an illusion, and it is especially true in the presense of fast-forward
> merge (aka the upstream maintainer asking a subsystem lieutenant to do a
> merge for him).
Hi Guys,
Many thanks for the replies which make sense.

I guess the thing that prompted my original email was the fact that when you look at output from gitk, the "distance" between 1.5.6.3 and HEAD is only a few commits and that led me to expect that the output of describe would show a smaller number than it does. I now understand why it is how it is.

However, the git describe manual page does mention branches:
Show 8 quoted lines
>With something like git.git current tree, I get:
>
>           [torvalds@g5 git]$ git-describe parent
>           v1.0.4-14-g2414721
>i.e. the current head of my "parent" branch is based on v1.0.4,
>but since it has a handful commits on top of that, describe has added
>the number of additional commits ("14") and an abbreviated object name
>for the commit itself ("2414721") at the end.

If you're a git newbie (like me) those words suggest that the commits are "on" branch parent and you could measure the direct distance between them by following the branch. Perhaps, the manual page should contain a sentence similar to this:

Branches have no influence on the git describe long format output which is derived only from the number of commits in the chain from the described tag to the committish.

Cheers,
Mark
Previous: Junio C Hamano
Message 6 of 6 in “Git describe question”
  1. Mark BurtonJul 14, 2008
  2. Junio C HamanoJul 14, 2008
  3. Mark BurtonJul 14, 2008
  4. Jean-Luc HerrenJul 14, 2008
  5. Junio C HamanoJul 14, 2008
  6. Mark BurtonJul 15, 2008

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.