dh-make-golang
dh-make-golang copied to clipboard
pkgVersionFromGit indiscriminately say "latest tag" even if -git_revision is used
(Note-to-self to fix a minor bug that I introduced myself.)
Since around dh-make-golang v0.2.0, pkgVersionFromGit() would print log messages like the following:
log.Printf("Found latest tag %q", latestTag)
log.Printf("WARNING: Latest tag %q is not a valid SemVer version\n", latestTag)
log.Printf("Latest tag %q matches master", latestTag)
saying it is the "latest tag" even if the user had specify an older tag -git_revision
.
For example, even if the actual latest release is v1.1.9, the log message claims v1.1.2 is the latest:
$ dh-make-golang make -git_revision v1.1.2 github.com/yuin/goldmark
2019/11/29 14:02:38 Downloading "github.com/yuin/goldmark/..."
2019/11/29 14:02:39 Determining upstream version number
2019/11/29 14:02:39 Found latest tag "v1.1.2"
2019/11/29 14:02:39 Latest tag "v1.1.2" matches master
2019/11/29 14:02:39 Package version is "1.1.2"
(removing from milestone since already released)