the output produced by for-each-rev is lexicographic.
Signed-off-by: oppiliappan me@oppi.li
··· 2 2 3 3 import ( 4 4 "fmt" 5 5 - "slices" 6 5 "strconv" 7 6 "strings" 8 7 "time" ··· 35 34 outFormat.WriteString("") 36 35 outFormat.WriteString(recordSeparator) 37 36 38 38 - output, err := g.forEachRef(outFormat.String(), "refs/tags") 37 37 + output, err := g.forEachRef(outFormat.String(), "--sort=-creatordate", "refs/tags") 39 38 if err != nil { 40 39 return nil, fmt.Errorf("failed to get tags: %w", err) 41 40 } ··· 94 93 tags = append(tags, tag) 95 94 } 96 95 97 97 - slices.Reverse(tags) 98 96 return tags, nil 99 97 }