Git development
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Jay Soffian <jaysoffian@gmail.com>
Cc: Markus Heidelberg <markus.heidelberg@web.de>, git@vger.kernel.org
Subject: Re: meaning of "-g" in git-describe output
Date: Wed, 17 Mar 2010 18:19:28 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.00.1003171811420.18017@i5.linux-foundation.org> (raw)
In-Reply-To: <76718491003171614r2e8ce0e5r3e4799503194831c@mail.gmail.com>



On Wed, 17 Mar 2010, Jay Soffian wrote:
> 
> My guess, from 908e531 (Add a "git-describe" command, 2005-12-24), is
> that it's short for "git":

Indeed. I actually wanted to make it possible to use other SCM's, even if 
it's stupid. And git is not the only one that uses hashes for versioning, 
so the "g" prefix is there to allow others that use -hg or monotone or 
similar to work.

For the kernel, if you use mercurial, the kernel version prefix will be 
"hg", for example. For SVN, it will be "svn" (but the numbers won't be a 
hex number, they'll be the SVN revno). See 'scripts/setlocalversion' in 
the kernel tree for an example.

So 'git describe' tries to match this kind of "multi-SCM model", where you 
can describe versions of your software in an environment where people may 
well use different SCMs.

Of course, if you use "git describe", you'll always get the "g" thing, and 
it is entirely redundant within the settign of just git. But in a bigger 
setting, the point is that I can do this:

	[torvalds@i5 linux]$ git describe; uname -r
	v2.6.34-rc1-997-ga3d3203
	2.6.34-rc1-00959-gbca14dd

and they have basically the same format (not 100% identical, but the 
"-g<sha1>" part is similar - the SHA1's obviously don't match in this 
case, because the kernel I'm running is ~40 commits away from my current 
tip of tree, but you can see the pattern).

			Linus

  reply	other threads:[~2010-03-18  1:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17 22:20 meaning of "-g" in git-describe output Markus Heidelberg
2010-03-17 23:14 ` Jay Soffian
2010-03-18  1:19   ` Linus Torvalds [this message]
2010-03-22 20:45     ` [PATCH] Documentation: explain the " Markus Heidelberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.00.1003171811420.18017@i5.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=git@vger.kernel.org \
    --cc=jaysoffian@gmail.com \
    --cc=markus.heidelberg@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox