Thread (19 messages) flat view 19 messages, 8 authors, 2016-08-11

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

From: Andy Whitcroft <hidden>
Date: 2016-08-11 19:55:05

Santi Béjar wrote:
On 11/2/06, Andy Whitcroft [off-list ref] wrote:
quoted
Santi Béjar wrote:
quoted
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.
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help