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

Re: Suggestion: drop 'g' in git-describe suffix

From
Andy Whitcroft <apw@shadowen.org>
Date
Nov 2, 2006, 13:52 UTC
Message-ID
<4549F821.9090600@shadowen.org>
In-Reply-To
<8aa486160611020439r255bcdb1q6e7ece46c77de11c@mail.gmail.com>
Santi Béjar wrote:
Show 17 quoted lines
> On 11/2/06, Andy Whitcroft <apw@shadowen.org> wrote:
>> Santi Béjar wrote:
>> > One problem I see with this scheme (either 'g', 'git' of '+') is that
>> > it does not provide an increasing version number, even for
>> > fast-forwarding commits. Then it is not useful as a package version
>> > number (deb or rpm). I've already seen deb packages with
>> > version+git20061010. One possibility could be to add the number of
>> > commits between the tag and the commit as:
>> >
>> > v1.4.3.3-git12g1e1f76e
>> >
>> > to provide a weak ordering for fast-forwarding commits. What do you
>> thing?
>>
>> I think you'll restart the 1.2.3.4 versioning is better 'debate' again!
> 
> Sorry, I don't undestand this.

There was a long running debate between sha1's and version 'numbers' 1.2.3.4 for each revision.

Show 11 quoted lines
> 
>> Surly if things are being pushed into a .deb or .rpm we should be using
>> a real release version.  We should be tagging that.  If the project is
>> not providing release number, there is nothing stopping you from tagging
>> them yourself in your copy of the repository and using your tag.  you
>> could use like 'unofficial-N' where N increments in the way you want.
> 
> And where do you store this tag? It is an upstream commit and you just
> refer to this. With the unofficial-N there is no way to know which
> upstream commit you are refering without having access to the git
> repository of the packager  .

Yes that is completly true, but its normally the packer who is doing the bug fixing of the .deb when its broken. The key problem is you need your numbering to be stable. The only guarenteed stable thing is the sha1, tags can change. IMHO you should be including the full sha1 in the --version output and the package descript, whatever versioning you are using on the .deb itself.

That said I guess it would be pretty easy to come up with something to count the number of commits since the last valid tag, something like that below. Might not be pretty, nor so easy to turn back into a commit of course.

-apw
#!/bin/sh
let n=0
git log --pretty=one "$@" | \
        awk '{print $1}' | \
        git name-rev --tags --stdin | \
{
        while read sha1 name
        do
                if [ "$name" != "" ]; then
                        echo "$sha1 $name $n"
                        exit 0
                fi
                let "n=n+1"
        done
        echo "- unknown 0"
        exit 1
Previous: Santi BéjarNext: Han-Wen Nienhuys
Message 10 of 19 in “Suggestion: drop 'g' in git-describe suffix”
  1. Han-Wen NienhuysNov 2, 2006
  2. Andy WhitcroftNov 2, 2006
  3. Han-Wen NienhuysNov 2, 2006
  4. Andy WhitcroftNov 2, 2006
  5. Han-Wen NienhuysNov 2, 2006
  6. Johannes SchindelinNov 2, 2006
  7. Santi BéjarNov 2, 2006
  8. Andy WhitcroftNov 2, 2006
  9. Santi BéjarNov 2, 2006
  10. Andy WhitcroftNov 2, 2006
  11. Han-Wen NienhuysNov 2, 2006
  12. Santi BéjarNov 2, 2006
  13. Jakub NarebskiNov 2, 2006
  14. Nicolas Vilz 'niv'Nov 2, 2006
  15. Johannes SchindelinNov 2, 2006
  16. Nicolas Vilz 'niv'Nov 2, 2006
  17. Andy WhitcroftNov 2, 2006
  18. Petr BaudisNov 2, 2006
  19. Carl WorthNov 2, 2006

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.