From e4e395ee3996eceb605551cd5f5d5a8806cd5ab0 Mon Sep 17 00:00:00 2001 From: Beatriz Vieira Date: Sat, 10 Apr 2021 17:01:58 -0300 Subject: [PATCH 1/2] feat: support lightweight tags issue: #16 --- sv/git.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sv/git.go b/sv/git.go index 0b94c13..5c5b662 100644 --- a/sv/git.go +++ b/sv/git.go @@ -80,7 +80,7 @@ func NewGit(messageProcessor MessageProcessor, cfg TagConfig) *GitImpl { // Describe runs git describe, it no tag found, return empty func (GitImpl) Describe() string { - cmd := exec.Command("git", "describe", "--abbrev=0") + cmd := exec.Command("git", "describe", "--abbrev=0", "--tags") out, err := cmd.CombinedOutput() if err != nil { return "" @@ -138,7 +138,7 @@ func (g GitImpl) Tag(version semver.Version) error { // Tags list repository tags func (g GitImpl) Tags() ([]GitTag, error) { - cmd := exec.Command("git", "tag", "-l", "--format", "%(taggerdate:iso8601)#%(refname:short)") + cmd := exec.Command("git", "for-each-ref", "--sort", "creatordate", "--format", "%(creatordate:iso8601)#%(refname:short)", "refs/tags") out, err := cmd.CombinedOutput() if err != nil { return nil, combinedOutputErr(err, out) From 8ff0147ec9cbf16be51b8286e49dbd7b2497f30c Mon Sep 17 00:00:00 2001 From: Beatriz Vieira Date: Sat, 10 Apr 2021 17:18:14 -0300 Subject: [PATCH 2/2] fix: use full version and not only major, minor and patch at changelog and releasenotes issue: #16 --- sv/formatter.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sv/formatter.go b/sv/formatter.go index 45d32c9..d4ef8f2 100644 --- a/sv/formatter.go +++ b/sv/formatter.go @@ -2,7 +2,6 @@ package sv import ( "bytes" - "fmt" "text/template" ) @@ -96,7 +95,7 @@ func releaseNoteVariables(releasenote ReleaseNote) releaseNoteTemplateVariables var version = "" if releasenote.Version != nil { - version = fmt.Sprintf("%d.%d.%d", releasenote.Version.Major(), releasenote.Version.Minor(), releasenote.Version.Patch()) + version = releasenote.Version.String() } return releaseNoteTemplateVariables{ Version: version,