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

Re: [PATCH] Teach git-describe --long to output always the long format

From
Jakub Narebski <jnareb@gmail.com>
Date
Feb 25, 2008, 08:50 UTC
Message-ID
<m3oda5betk.fsf@localhost.localdomain>
In-Reply-To
<7vwsotpwbr.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 13 quoted lines
> "Shawn O. Pearce" <spearce@spearce.org> writes:
> 
>>> +		else
>>> +			printf("%s-0-g%s\n", n->path,
>>> +				find_unique_abbrev(cmit->object.sha1, abbrev));
>>
>> Is this really that useful?  Where is having the tag and the commit
>> SHA-1 both useful?
> 
> I had the same question.  The only place that I find this could
> be useful is when you tag, build and install, and then find
> glitches before pushing the results out and rewind, rebuild and
> re-tag.  I unfortunately have this issue almost all the time.

Another place where it is useful is parsing git-describe output, for example in .spec file for RPM, if you want to avoid hardcoding the information about the form of tags in a project (tags can, and sometimes do, contain '-'). If you always use --long form, it is easy to separate number of commits from tag and shortened sha1 from the tag itself, for example to put closest tag as version number, and make number of commits and perhaps also shortened sha1 into release number.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Santi BéjarNext: Santi Béjar
Message 11 of 12 in “Teach git-describe --long to output always the long format”
  1. Teach git-describe --long to output always the long formatSanti Béjar, Feb 24, 2008
  2. Shawn O. PearceFeb 25, 2008
  3. Junio C HamanoFeb 25, 2008
  4. Santi BéjarFeb 25, 2008
  5. Junio C HamanoFeb 25, 2008
  6. Santi BéjarFeb 25, 2008
  7. Junio C HamanoFeb 25, 2008
  8. Santi BéjarFeb 25, 2008
  9. Junio C HamanoFeb 26, 2008
  10. Santi BéjarFeb 26, 2008
  11. Jakub NarebskiFeb 25, 2008
  12. Teach git-describe --long to output always the long formatSanti Béjar, Feb 25, 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.