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

Re: [PATCH] More precise description of 'git describe --abbrev'

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 30, 2009, 19:00 UTC
Message-ID
<7viqdwlnam.fsf@alter.siamese.dyndns.org>
In-Reply-To
<b48ea8a00910300101i38f2e4a8q2c2e014d2df1a150@mail.gmail.com>
Gisle Aas <gisle@aas.no> writes:
Show 20 quoted lines
> On Thu, Oct 29, 2009 at 23:47, Junio C Hamano <gitster@pobox.com> wrote:
>> Gisle Aas <gisle@aas.no> writes:
>>
>>> Also make the examples show what 'git describe' actually outputs
>>> currently.  I guess the default --abbrev value has been changed from 4
>>> to 7 at some point.
>>
>> Some are good changes, but I do not think the example with --abbrev=4 is.
>>
>> $ git describe 975bf9cf5ad5d440f98f464ae8124609a4835ce1
>> v1.3.2-216-g975bf9c
>> $ git describe 975b31dc6e12fba8f7b067ddbe32230995e05400
>> v1.0.0-21-g975b31d
>>
>> Next time somebody adds a new object whose name happens to begin with
>> 975b3 you would need to update the example output.
>
> Yeah, I know, but I don't think that's a big deal.  So do you want an
> updated patch for that?  We could either simply remove this example or
> make it use --abbrev=10 or something like that.
Not touching the example would be the simplest.

Adding an explanation like this so that nobody will be tempted to "fix" the example would be the best, I think.

     [torvalds@g5 git]$ git describe --all --abbrev=4 v1.0.5^2
     tags/v1.0.0-21-g975b
     Note that the suffix you get if you type this command today may be
     longer than what Linus saw above when he ran this command, as your
     git repository may have new commits whose object names begin with
     975b that did not exist back then, and "-g975b" suffix alone is not
     sufficient to disambiguate these commits.
Previous: Gisle AasNext: Gisle Aas
Message 4 of 8 in “More precise description of 'git describe --abbrev'”
  1. More precise description of 'git describe --abbrev'Gisle Aas, Oct 29, 2009
  2. Junio C HamanoOct 29, 2009
  3. Gisle AasOct 30, 2009
  4. Junio C HamanoOct 30, 2009
  5. Gisle AasOct 30, 2009
  6. Andreas SchwabOct 30, 2009
  7. Junio C HamanoOct 30, 2009
  8. Gisle AasNov 4, 2009

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.