mirror of
https://github.com/git-chglog/git-chglog.git
synced 2026-01-23 02:15:12 +00:00
parent
75d59a9eb8
commit
44f71cbcd8
5 changed files with 192 additions and 44 deletions
|
|
@ -128,8 +128,19 @@ func (e *commitExtractor) commitGroupTitle(commit *Commit) (string, string) {
|
|||
}
|
||||
|
||||
func (e *commitExtractor) sortCommitGroups(groups []*CommitGroup) {
|
||||
order := make(map[string]int)
|
||||
if e.opts.CommitGroupSortBy == "Custom" {
|
||||
for i, t := range e.opts.CommitGroupTitleOrder {
|
||||
order[t] = i
|
||||
}
|
||||
}
|
||||
|
||||
// groups
|
||||
sort.Slice(groups, func(i, j int) bool {
|
||||
if e.opts.CommitGroupSortBy == "Custom" {
|
||||
return order[groups[i].RawTitle] < order[groups[j].RawTitle]
|
||||
}
|
||||
|
||||
var (
|
||||
a, b interface{}
|
||||
ok bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue