From 94b52af661dd8b61c60b5801106025e4a81be7b6 Mon Sep 17 00:00:00 2001 From: Robert Verst Date: Mon, 31 May 2021 18:15:02 +0200 Subject: [PATCH] Remove config, make default sort order `descending` --- docs/Config.md | 1 - pkg/commands/loading_tags.go | 4 ++-- pkg/config/user_config.go | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/Config.md b/docs/Config.md index c322f2e8778..c37747dbe37 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -44,7 +44,6 @@ gui: showRandomTip: true showCommandLog: true commandLogSize: 8 - sortTagsDescending: false # sort order for tags git: paging: colorArg: always diff --git a/pkg/commands/loading_tags.go b/pkg/commands/loading_tags.go index 21925f18463..8bd66c9367a 100644 --- a/pkg/commands/loading_tags.go +++ b/pkg/commands/loading_tags.go @@ -46,8 +46,8 @@ func (c *GitCommand) GetTags() ([]*models.Tag, error) { // now lets sort our tags by name numerically re := regexp.MustCompile(semverRegex) - sortAsc := !c.Config.GetUserConfig().Gui.SortTagsDescending - // the reason this is complicated is because we're both sorting alphabetically + sortAsc := c.Config.GetUserConfig().Gui.SortTagsAscending + // the reason this is complicated is because we're both sorting alphabetically // and when we're dealing with semver strings sort.Slice(tags, func(i, j int) bool { var a, b string diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go index 528830874aa..074dcbc6319 100644 --- a/pkg/config/user_config.go +++ b/pkg/config/user_config.go @@ -39,7 +39,7 @@ type GuiConfig struct { ShowRandomTip bool `yaml:"showRandomTip"` ShowCommandLog bool `yaml:"showCommandLog"` CommandLogSize int `yaml:"commandLogSize"` - SortTagsDescending bool `yaml:"sortTagsDescending"` + SortTagsAscending bool `yaml:"sortTagsAscending"` } type ThemeConfig struct { @@ -308,7 +308,7 @@ func GetDefaultConfig() *UserConfig { ShowFileTree: false, ShowRandomTip: true, CommandLogSize: 8, - SortTagsDescending: false, + SortTagsAscending: false, }, Git: GitConfig{ Paging: PagingConfig{