git-describe: what is the '-g' prefix good for?

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

git-describe: what is the '-g' prefix good for?

From: Dirk Süsserott <hidden>
Date: 2016-06-15 22:47:04

Hello there,

I'm a bit surprised about the output of git-describe: if I'm on a tag,
git-describe tells the tag's name. Fine. If I commit sth. on top of
that, it tells how far I'm away from that tag and the current commit's
SHA1. Very fine. But then the SHA1 is preceeded with a '-g'. What's that
for?

I really don't want to ask for dropping it (I guess all people rely
on it), but does anybody know about the initial intention of that '-g'?
Cannot be easier parsing in porcelain scripts because either way the
actual state is unambiguously.

Just a curious
     Dirk

Re: git-describe: what is the '-g' prefix good for?

From: Avery Pennarun <hidden>
Date: 2016-06-15 22:47:04

2009/7/16 Dirk Süsserott [off-list ref]:
I'm a bit surprised about the output of git-describe: if I'm on a tag,
git-describe tells the tag's name. Fine. If I commit sth. on top of
that, it tells how far I'm away from that tag and the current commit's
SHA1. Very fine. But then the SHA1 is preceeded with a '-g'. What's that
for?
I'm sure it stands for something like "git".  You don't want a random
number appended to your tagname (which is often a version number)
because it might be mistaken for part of the version number.  The g
makes this less likely.  It also differentiates between git and any
other version control system (except ones starting with 'g', I guess
:)) that might implement a similar feature.

Avery
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help