{"thread":{"id":"23056","subject":"meaning of \"-g\" in git-describe output","startedAt":"2010-03-17T22:20:44Z","lastAt":"2010-03-22T20:45:33Z","messageCount":4,"participants":["Markus Heidelberg","Jay Soffian","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"137063","messageId":"201003172320.45058.markus.heidelberg@web.de","threadId":"23056","inReplyTo":null,"subject":"meaning of \"-g\" in git-describe output","fromName":"Markus Heidelberg","fromEmail":"markus.heidelberg@web.de","sentAt":"2010-03-17T22:20:44Z","receivedAt":"2010-03-17T22:20:44Z","isPatch":false,"sender":{"key":"markus.heidelberg@web.de","avatar":"https://avatars.githubusercontent.com/u/6334512?v=4"},"body":"Hello,\n\nwhat is the meaning of the character 'g' in output like v1.0.4-14-g2414721 ?\nIs it simply the first letter, which isn't used in hexadecimal numbers\nor has it a deeper sense?\n\nMarkus\n"},{"id":"137064","messageId":"76718491003171614r2e8ce0e5r3e4799503194831c@mail.gmail.com","threadId":"23056","inReplyTo":"201003172320.45058.markus.heidelberg@web.de","subject":"Re: meaning of \"-g\" in git-describe output","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2010-03-17T23:14:00Z","receivedAt":"2010-03-17T23:14:00Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Wed, Mar 17, 2010 at 6:20 PM, Markus Heidelberg\n<markus.heidelberg@web.de> wrote:\n> Hello,\n>\n> what is the meaning of the character 'g' in output like v1.0.4-14-g2414721 ?\n> Is it simply the first letter, which isn't used in hexadecimal numbers\n> or has it a deeper sense?\n\nMy guess, from 908e531 (Add a \"git-describe\" command, 2005-12-24), is\nthat it's short for \"git\":\n\n    IOW, with something like Junios current tree, I get:\n\n        [torvalds@g5 git]$ git-describe parent\n        refs/tags/v1.0.4-g2414721b\n\n    ie the current head of my \"parent\" branch (ie Junio) is based on v1.0.4,\n    but since it has a few commits on top of that, it has added the git hash\n    of the thing to the end: \"-g\" + 8-char shorthand for the commit\n    2414721b194453f058079d897d13c4e377f92dc6.\n\n    -- http://marc.info/?t=113546113600001\n\nBut I think only Linus (+cc) knows. :-)\n\nj.\n"},{"id":"137067","messageId":"alpine.LFD.2.00.1003171811420.18017@i5.linux-foundation.org","threadId":"23056","inReplyTo":"76718491003171614r2e8ce0e5r3e4799503194831c@mail.gmail.com","subject":"Re: meaning of \"-g\" in git-describe output","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2010-03-18T01:19:28Z","receivedAt":"2010-03-18T01:19:28Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 17 Mar 2010, Jay Soffian wrote:\n> \n> My guess, from 908e531 (Add a \"git-describe\" command, 2005-12-24), is\n> that it's short for \"git\":\n\nIndeed. I actually wanted to make it possible to use other SCM's, even if \nit's stupid. And git is not the only one that uses hashes for versioning, \nso the \"g\" prefix is there to allow others that use -hg or monotone or \nsimilar to work.\n\nFor the kernel, if you use mercurial, the kernel version prefix will be \n\"hg\", for example. For SVN, it will be \"svn\" (but the numbers won't be a \nhex number, they'll be the SVN revno). See 'scripts/setlocalversion' in \nthe kernel tree for an example.\n\nSo 'git describe' tries to match this kind of \"multi-SCM model\", where you \ncan describe versions of your software in an environment where people may \nwell use different SCMs.\n\nOf course, if you use \"git describe\", you'll always get the \"g\" thing, and \nit is entirely redundant within the settign of just git. But in a bigger \nsetting, the point is that I can do this:\n\n\t[torvalds@i5 linux]$ git describe; uname -r\n\tv2.6.34-rc1-997-ga3d3203\n\t2.6.34-rc1-00959-gbca14dd\n\nand they have basically the same format (not 100% identical, but the \n\"-g<sha1>\" part is similar - the SHA1's obviously don't match in this \ncase, because the kernel I'm running is ~40 commits away from my current \ntip of tree, but you can see the pattern).\n\n\t\t\tLinus\n"},{"id":"137586","messageId":"201003222145.33383.markus.heidelberg@web.de","threadId":"23056","inReplyTo":"alpine.LFD.2.00.1003171811420.18017@i5.linux-foundation.org","subject":"[PATCH] Documentation: explain the meaning of \"-g\" in git-describe output","fromName":"Markus Heidelberg","fromEmail":"markus.heidelberg@web.de","sentAt":"2010-03-22T20:45:33Z","receivedAt":"2010-03-22T20:45:33Z","isPatch":true,"sender":{"key":"markus.heidelberg@web.de","avatar":"https://avatars.githubusercontent.com/u/6334512?v=4"},"body":"Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>\n---\n\nLinus Torvalds, 2010-03-18 02:19:\n> \n> On Wed, 17 Mar 2010, Jay Soffian wrote:\n> > \n> > My guess, from 908e531 (Add a \"git-describe\" command, 2005-12-24), is\n> > that it's short for \"git\":\n> \n> Indeed. I actually wanted to make it possible to use other SCM's, even if \n> it's stupid. And git is not the only one that uses hashes for versioning, \n> so the \"g\" prefix is there to allow others that use -hg or monotone or \n> similar to work\n\nI really hadn't thought of this obvious explanation.\n\n Documentation/git-describe.txt |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-describe.txt b/Documentation/git-describe.txt\nindex 6fc5323..d9311dd 100644\n--- a/Documentation/git-describe.txt\n+++ b/Documentation/git-describe.txt\n@@ -105,6 +105,9 @@ The number of additional commits is the number\n of commits which would be displayed by \"git log v1.0.4..parent\".\n The hash suffix is \"-g\" + 7-char abbreviation for the tip commit\n of parent (which was `2414721b194453f058079d897d13c4e377f92dc6`).\n+The \"g\" prefix stands for \"git\" and is used to allow describing the version of\n+a software depending on the SCM the software is managed with. This is useful\n+in an environment where people may use different SCMs.\n \n Doing a 'git describe' on a tag-name will just show the tag name:\n \n-- \n1.7.0.3.257.gcd709\n"}]}