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

Re: describe fails on tagless branch

From
Jakub Narebski <jnareb@gmail.com>
Date
Feb 7, 2007, 09:08 UTC
Message-ID
<eqc4s4$nm9$1@sea.gmane.org>
In-Reply-To
<7vr6t2g1dt.fsf@assigned-by-dhcp.cox.net>
[Cc: git@vger.kernel.org]
Junio C Hamano wrote:
Show 18 quoted lines
> Han-Wen Nienhuys <hanwen@xs4all.nl> writes:
> 
>> Jakub Narebski escreveu:
>>> 
>>> _Which_ INIT? In git there can be more than one root commit. In git.git
>>
>> I don't really care, but I would like git-describe to produce something 
>> useful in the absence of tags.  The -g<SHA-1> already makes the commit
>> uniquely identifiable.
> 
> Then you would script like this:
> 
>       #!/bin/sh
>       git describe "$1" 2>/dev/null || git rev-parse --verify "$1"
> 
> I do not think it a good idea to make "git-describe" itself do
> the above, as the user of describe may want to fall back on
> something other than "rev-parse --verify" after ||.

By the way, new git-describe gives us also number of commits since tag, and it would be nice to have number of commits since init... but that can be easily obtained using "git rev-list $1 | wc -l".

I guess that some use git-describe with --abbrev=0 to get closest preceding tag: getting INIT would confuse them.

That said, we could use e.g. INITg2a45ba+10-g4ee2ab
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Junio C HamanoNext: Andy Parkins
Message 5 of 10 in “describe fails on tagless branch”
  1. Han-Wen NienhuysFeb 7, 2007
  2. Jakub NarebskiFeb 7, 2007
  3. Han-Wen NienhuysFeb 7, 2007
  4. Junio C HamanoFeb 7, 2007
  5. Jakub NarebskiFeb 7, 2007
  6. Andy ParkinsFeb 7, 2007
  7. Junio C HamanoFeb 7, 2007
  8. Andy ParkinsFeb 7, 2007
  9. Jakub NarebskiFeb 7, 2007
  10. Junio C HamanoFeb 7, 2007

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.