{"thread":{"id":"14443","subject":"Git describe question","startedAt":"2008-07-14T07:55:57Z","lastAt":"2008-07-15T06:40:00Z","messageCount":6,"participants":["Mark Burton","Junio C Hamano","Jean-Luc Herren"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"83232","messageId":"20080714085557.246f52b9@crow","threadId":"14443","inReplyTo":null,"subject":"Git describe question","fromName":"Mark Burton","fromEmail":"markb@ordern.com","sentAt":"2008-07-14T07:55:57Z","receivedAt":"2008-07-14T07:55:57Z","isPatch":false,"sender":{"key":"markb@ordern.com","avatar":null},"body":"Hi,\n\nHaving just pulled the latest updates, git describe says:\n\nv1.5.6.3-315-g10ce020\n\nWhy does it think there are 315 commits on top of the v1.5.6.3 tag? I\nwould have expected a much smaller number than that.\n\nThanks,\n\nMark\n"},{"id":"83233","messageId":"7vvdz8hp3d.fsf@gitster.siamese.dyndns.org","threadId":"14443","inReplyTo":"20080714085557.246f52b9@crow","subject":"Re: Git describe question","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-14T08:00:54Z","receivedAt":"2008-07-14T08:00:54Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mark Burton <markb@ordern.com> writes:\n\n> Having just pulled the latest updates, git describe says:\n>\n> v1.5.6.3-315-g10ce020\n>\n> Why does it think there are 315 commits on top of the v1.5.6.3 tag?\n\nShort answer.  Because there are.  Count'em ;-)\n\n\t$ git rev-list v1.5.6.3..master | wc -l\n\nA longer answer.  v1.5.6.X releases are from 'maint'.  The branch has\nforked from the mainline loooong time ago (at v1.5.6, to be exact), and\nhas only fixes.  'master' is a separate branch for development that would\neventually lead to the next major release (planned to be v1.6.0).\n"},{"id":"83237","messageId":"20080714092040.4090046b@crow","threadId":"14443","inReplyTo":"7vvdz8hp3d.fsf@gitster.siamese.dyndns.org","subject":"Re: Git describe question","fromName":"Mark Burton","fromEmail":"markb@ordern.com","sentAt":"2008-07-14T08:20:40Z","receivedAt":"2008-07-14T08:20:40Z","isPatch":false,"sender":{"key":"markb@ordern.com","avatar":null},"body":"\nThanks for the speedy response.\n\n> A longer answer.  v1.5.6.X releases are from 'maint'.  The branch has\n> forked from the mainline loooong time ago (at v1.5.6, to be exact), and\n> has only fixes.  'master' is a separate branch for development that would\n> eventually lead to the next major release (planned to be v1.6.0).\n\nOk, I understand what it's doing now - but that makes me wonder if it\nwould be useful/possible to be able to specify that git describe only\nconsiders the commits on top of the tag for the current (or some\nspecified branch). i.e. at the moment, gitk shows 8 commits on top of\nv1.5.6.3 in the master branch.\n\nAs the master branch is the checked out branch and the v1.5.6.3 tag\ntags a commit in that branch (via the merge) is it not possible to only\nconsider the commits between the tag and the HEAD on that branch?\n\nSorry, I don't understand the git internals (yet) so I don't know if\nthis is a stupid question and I am certainly not in a position to try\nand implement it myself (yet).\n\nCheers,\n\nMark\n"},{"id":"83311","messageId":"487BD34F.4080201@gmx.ch","threadId":"14443","inReplyTo":"20080714092040.4090046b@crow","subject":"Re: Git describe question","fromName":"Jean-Luc Herren","fromEmail":"jlh@gmx.ch","sentAt":"2008-07-14T22:29:35Z","receivedAt":"2008-07-14T22:29:35Z","isPatch":false,"sender":{"key":"jlh@gmx.ch","avatar":null},"body":"Mark Burton wrote:\n> Ok, I understand what it's doing now - but that makes me wonder if it\n> would be useful/possible to be able to specify that git describe only\n> considers the commits on top of the tag for the current (or some\n> specified branch). i.e. at the moment, gitk shows 8 commits on top of\n> v1.5.6.3 in the master branch.\n\nAre you saying \"git describe\" should output v1.5.6.3-8-g10ce020?\nThat would be misleading and even wrong.  This would be like\nsaying that there are only 8 commits of difference between\nv1.5.6.3 and 10ce20, which is not true.  The differences between\nthose two commits are over 300 single commits and that's also what\n\"git (log|diff) v1.5.6.3..10ce20\" will tell you.  All 300+ commits\nthat have been made to the branch master since the branch maint\nforked off are part of 10ce20, but not part of v1.5.6.3.  It seems\nfine to me that \"git describe\" reflects this difference.\n\n> As the master branch is the checked out branch and the v1.5.6.3 tag\n> tags a commit in that branch (via the merge) [...]\n\nI don't think people usually say \"tag X is on branch Y\", excepted\nmaybe if Y has never been merged anywhere.  Specifically, nobody\nwould say v1.5.6.3 is *on* branch master.  But it's part of its\nhistory.  v1.5.6.3 is *on* maint, at best.\n\njlh\n"},{"id":"83316","messageId":"7v1w1wf42n.fsf@gitster.siamese.dyndns.org","threadId":"14443","inReplyTo":"487BD34F.4080201@gmx.ch","subject":"Re: Git describe question","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-14T23:17:52Z","receivedAt":"2008-07-14T23:17:52Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jean-Luc Herren <jlh@gmx.ch> writes:\n\n> Mark Burton wrote:\n> ...\n> I don't think people usually say \"tag X is on branch Y\", excepted\n> maybe if Y has never been merged anywhere.  Specifically, nobody\n> would say v1.5.6.3 is *on* branch master.  But it's part of its\n> history.  v1.5.6.3 is *on* maint, at best.\n\nActually I am somewhat sympathetic to Mark here.  Probably what he wants\nis to describe 10ce020 as v1.5.6-390-10ce020.\n\nWhile that probably is doable by using the first-parent-only traversal, I\ndo not think it is such a good idea.  It is not how branches in git are\ndesigned to work.  As Merlyn always says in #git at freenode, a branch is\nan illusion, and it is especially true in the presense of fast-forward\nmerge (aka the upstream maintainer asking a subsystem lieutenant to do a\nmerge for him).\n"},{"id":"83369","messageId":"20080715074000.110b896e@crow","threadId":"14443","inReplyTo":"7v1w1wf42n.fsf@gitster.siamese.dyndns.org","subject":"Re: Git describe question","fromName":"Mark Burton","fromEmail":"markb@ordern.com","sentAt":"2008-07-15T06:40:00Z","receivedAt":"2008-07-15T06:40:00Z","isPatch":false,"sender":{"key":"markb@ordern.com","avatar":null},"body":"On Mon, 14 Jul 2008 16:17:52 -0700\nJunio C Hamano <gitster@pobox.com> wrote:\n\n> Jean-Luc Herren <jlh@gmx.ch> writes:\n> \n> > Mark Burton wrote:\n> > ...\n> > I don't think people usually say \"tag X is on branch Y\", excepted\n> > maybe if Y has never been merged anywhere.  Specifically, nobody\n> > would say v1.5.6.3 is *on* branch master.  But it's part of its\n> > history.  v1.5.6.3 is *on* maint, at best.\n> \n> Actually I am somewhat sympathetic to Mark here.  Probably what he wants\n> is to describe 10ce020 as v1.5.6-390-10ce020.\n> \n> While that probably is doable by using the first-parent-only traversal, I\n> do not think it is such a good idea.  It is not how branches in git are\n> designed to work.  As Merlyn always says in #git at freenode, a branch is\n> an illusion, and it is especially true in the presense of fast-forward\n> merge (aka the upstream maintainer asking a subsystem lieutenant to do a\n> merge for him).\n\nHi Guys,\n\nMany thanks for the replies which make sense.\n\nI guess the thing that prompted my original email was the fact that\nwhen you look at output from gitk, the \"distance\" between 1.5.6.3 and\nHEAD is only a few commits and that led me to expect that the output of\ndescribe would show a smaller number than it does. I now understand why\nit is how it is.\n\nHowever, the git describe manual page does mention branches:\n\n>With something like git.git current tree, I get:\n>\n>           [torvalds@g5 git]$ git-describe parent\n>           v1.0.4-14-g2414721\n>i.e. the current head of my \"parent\" branch is based on v1.0.4,\n>but since it has a handful commits on top of that, describe has added\n>the number of additional commits (\"14\") and an abbreviated object name\n>for the commit itself (\"2414721\") at the end.\n\nIf you're a git newbie (like me) those words suggest that the commits\nare \"on\" branch parent and you could measure the direct distance\nbetween them by following the branch. Perhaps, the manual page should\ncontain a sentence similar to this:\n\nBranches have no influence on the git describe long format output \nwhich is derived only from the number of commits in the chain from the\ndescribed tag to the committish.\n\nCheers,\n\nMark\n"}]}