[pkg-go] Usage of -git_revision option on dh-make-golang

Michael Stapelberg stapelberg at debian.org
Wed Nov 4 08:32:55 UTC 2015


Thanks for the feedback.

The problem with the repository at hand is that it’s using a light-weight
tag instead of an annotated tag:

$ cat .git/packed-refs
# pack-refs with: peeled fully-peeled
c7477ad8e330bef55bf1ebe300cf8aa67c492d1b refs/remotes/origin/master
46a638d98be2af4fa6de146b5d28a9d9904a3949 refs/tags/v0.1

$ git cat-file -t 46a638d98be2af4fa6de146b5d28a9d9904a3949
commit

The type of the tag should be “tag”, not “commit”, for an annotated tag.
Otherwise git-describe will not consider the tag. From git-tag(1):

    Annotated tags are meant for release while lightweight tags are meant
for private or temporary object labels. For this reason, some git commands
for naming objects (like git describe) will ignore lightweight tags by
default.

See also
https://stackoverflow.com/questions/11514075/what-is-the-difference-between-an-annotated-and-unannotated-tag

I think you should file a bug upstream and ask them to create annotated
tags for this release and in the future. Then, merely using
--git_revision=v0.1 should work with dh-make-golang.

I suppose we should add some logic to detect this problem and emit a
warning message in dh-make-golang. Could you file an issue for that at
https://github.com/Debian/dh-make-golang please?

If anyone else has a different idea, I’m all ears :).

On Wed, Nov 4, 2015 at 8:28 AM, Potter, Tim (Converged Cloud) <
timothy.potter at hpe.com> wrote:

> Hi Michael.  I’ve been using dh-make-golang a lot recently (thanks - it’s
> awesome!) but had a
> question about the -git_revision option.
>
> If I specify refs/tags/v0.1 then the package version is set to the git
> hash version string used
> when creating master snapshot packages.
>
> Would it be better to have a -version option to be able to set the package
> version number
> when using -git_revision?
>
> For example:
>
> root at b563bbeedb84:/# dh-make-golang -git_revision=refs/tags/v0.1
> github.com/codegangsta/negroni
> 2015/11/04 18:25:09 Downloading "github.com/codegangsta/negroni/..."
> 2015/11/04 18:25:14 Checking out git revision "refs/tags/v0.1"
> 2015/11/04 18:25:14 Determining upstream version number
> 2015/11/04 18:25:14 Package version is "0.0~git20140530.0.46a638d"
> 2015/11/04 18:25:14 Determining package type
> 2015/11/04 18:25:14 Determining dependencies
> [..]
>
> I need to go in and manually edit the d/changelog version number to be
> 0.1-1 whereas it
> would be nice if this were done using a command line option.
>
> Mind you not many packages I’ve seen have actual released versions.  I
> think I’ve recently
> uploaded about 10 and only two had releases.
>
> Thanks again for dh-make-golang!
>
>
> Tim.




-- 
Best regards,
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-go-maintainers/attachments/20151104/85f35c4a/attachment.html>


More information about the Pkg-go-maintainers mailing list