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

Re: Add a "git-describe" command

From
Junio C Hamano <junkio@cox.net>
Date
Dec 25, 2005, 09:44 UTC
Message-ID
<7vr781o6j9.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0512241939490.14098@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
> My real goal was to see a real meaningful version when I do "git 
> --version". I just hate how it normally just says it's version "1.0.GIT", 
> and I have no idea how new/old it really is.

Hmph. I am not so interested in "git --version", but I find git-describe to be pretty attractive.

Last night I proposed to tighten pack naming which would promote so-far just a convention to a rule, which would introduce an backward incompatibility and wanted to know which released versions are affected. With git-whatchanged I can identify the exact commit that changed the packname SHA1 computation with ease:

        $ git whatchanged --abbrev --pretty=oneline \
          -S'	sorted_by_sha = create_sorted_list(sha1_sort);
                SHA1_Init(&ctx);
                list = sorted_by_sha;
                for (i = 0; i < nr_objects; i++) {
        ' HEAD -- pack-objects.c
        diff-tree 84c8d8a... (from 9cf6d33...)
        Fix packname hash generation.
        :100644 100644 3d62278... ef55cab... M	pack-objects.c

and from that I would have been able to find that the change was between 0.99.8 and 0.99.9:

        $ git describe 84c8d8a
        refs/tags/v0.99.8-g84c8d8ae

I used "git-show-branch $that_commit tags/v0.99.?" to get that information instead, but git describe would have been very useful.

Previous: Linus Torvalds
Message 14 of 14 in “Add a "git-describe" command”
  1. Linus TorvaldsDec 24, 2005
  2. Linus TorvaldsDec 24, 2005
  3. M_Dec 25, 2005
  4. Junio C HamanoDec 28, 2005
  5. Johannes SchindelinDec 28, 2005
  6. 1/6 git-describe: really prefer tags only.Junio C Hamano, Dec 28, 2005
  7. 2/6 git-describe: use find_unique_abbrev()Junio C Hamano, Dec 28, 2005
  8. 3/6 git-describe: --tags and --abbrevJunio C Hamano, Dec 28, 2005
  9. 4/6 git-describe: still prefer annotated tag under --all and --tagsJunio C Hamano, Dec 28, 2005
  10. 5/6 git-describe: documentation.Junio C Hamano, Dec 28, 2005
  11. 6/6 Makefile: use git-describe to mark the git version.Junio C Hamano, Dec 28, 2005
  12. Junio C HamanoDec 25, 2005
  13. Linus TorvaldsDec 25, 2005
  14. Junio C HamanoDec 25, 2005

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.