Monorepo for Tangled tangled.org

knotserver: fix sort order of tags #610

merged opened by oppi.li targeting master from push-okxlrwoolxpr

the output produced by for-each-rev is lexicographic.

Signed-off-by: oppiliappan me@oppi.li

Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:qfpnj4og54vl56wngdriaxug/sh.tangled.repo.pull/3lzsyi6pnbj22
+1 -3
Diff #1
+1 -3
knotserver/git/tag.go
··· 2 2 3 3 import ( 4 4 "fmt" 5 - "slices" 6 5 "strconv" 7 6 "strings" 8 7 "time" ··· 35 34 outFormat.WriteString("") 36 35 outFormat.WriteString(recordSeparator) 37 36 38 - output, err := g.forEachRef(outFormat.String(), "refs/tags") 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 - slices.Reverse(tags) 98 96 return tags, nil 99 97 }

History

2 rounds 2 comments
sign up or login to add to the discussion
1 commit
expand
knotserver: fix sort order of tags
expand 0 comments
pull request successfully merged
oppi.li submitted #0
1 commit
expand
knotserver: fix sort order of tags
expand 2 comments

Have you considered just passing --sort=-creatordate to git for-each-ref?

ah of course! that would be much nicer. thanks for the suggestion!