Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions git/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func (g Git) PushTag(t tag.Tag) (err error) {

func runGitDescribe() (string, error) {
// The following glob(7) pattern is not perfect. It will match things like v1.4badstring.8
// But it narrows down the results by a good bit
cmd := exec.Command("git", "describe", "--abbrev=0", "--tags", "--match=v[0-9]*\\.[0-9]*\\.[0-9]*")
// But it narrows down the results by a good bit. It will exclude prerelease tags such as `v1.4.8-rc-1`
cmd := exec.Command("git", "describe", "--abbrev=0", "--tags", "--match=v[0-9]*\\.[0-9]*\\.[0-9]*", "--exclude=v[0-9]*\\.[0-9]*\\.[0-9]*-*")
// TODO: if we find a tag, but it's invalid (human created), we should retry and find the one previous.
// Probably with a `git describe <bad tag that was found>`
return runCommand(cmd)
Expand Down