mirror of
https://github.com/thegeeklab/git-sv.git
synced 2024-11-21 22:10:39 +00:00
commit
68f1b425ff
@ -2,7 +2,6 @@ package sv
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
|
||||||
"text/template"
|
"text/template"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -96,7 +95,7 @@ func releaseNoteVariables(releasenote ReleaseNote) releaseNoteTemplateVariables
|
|||||||
|
|
||||||
var version = ""
|
var version = ""
|
||||||
if releasenote.Version != nil {
|
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{
|
return releaseNoteTemplateVariables{
|
||||||
Version: version,
|
Version: version,
|
||||||
|
@ -80,7 +80,7 @@ func NewGit(messageProcessor MessageProcessor, cfg TagConfig) *GitImpl {
|
|||||||
|
|
||||||
// Describe runs git describe, it no tag found, return empty
|
// Describe runs git describe, it no tag found, return empty
|
||||||
func (GitImpl) Describe() string {
|
func (GitImpl) Describe() string {
|
||||||
cmd := exec.Command("git", "describe", "--abbrev=0")
|
cmd := exec.Command("git", "describe", "--abbrev=0", "--tags")
|
||||||
out, err := cmd.CombinedOutput()
|
out, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ""
|
return ""
|
||||||
@ -138,7 +138,7 @@ func (g GitImpl) Tag(version semver.Version) error {
|
|||||||
|
|
||||||
// Tags list repository tags
|
// Tags list repository tags
|
||||||
func (g GitImpl) Tags() ([]GitTag, error) {
|
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()
|
out, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, combinedOutputErr(err, out)
|
return nil, combinedOutputErr(err, out)
|
||||||
|
Loading…
Reference in New Issue
Block a user