summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2024-06-23 14:54:27 +0200
committerStefan Haller <stefan@haller-berlin.de>2024-06-29 11:28:00 +0200
commit7be82d47135d8fa28823c506080311cba6d7b5f0 (patch)
tree038ab57146428137037bf64d6e2a4ac5591611ee
parent5dbdbd8425b0319c4c78bc2453c10f8bf988f252 (diff)
Revert "Add user config gui.commitAuthorFormat (#3625)"
This reverts commit 3af545daf7cf6458e8efd324012047ce688f08e6, reversing changes made to 629b7ba1b8f634c26adad43ffe44ed601d652f0c. We changed our mind about this and want to provide different options for achieving the same thing, but with more flexibility.
-rw-r--r--docs/Config.md5
-rw-r--r--pkg/config/user_config.go5
-rw-r--r--pkg/config/user_config_validation.go5
-rw-r--r--pkg/gui/presentation/commits.go9
-rw-r--r--schema/config.json10
5 files changed, 2 insertions, 32 deletions
diff --git a/docs/Config.md b/docs/Config.md
index 88df40621..86e268550 100644
--- a/docs/Config.md
+++ b/docs/Config.md
@@ -185,11 +185,6 @@ gui:
# If true (default), file icons are shown in the file views. Only relevant if NerdFontsVersion is not empty.
showFileIcons: true
- # Whether to show full author names or their shortened form in the commit graph.
- # One of 'auto' (default) | 'full' | 'short'
- # If 'auto', initials will be shown in small windows, and full names - in larger ones.
- commitAuthorFormat: auto
-
# Length of commit hash in commits view. 0 shows '*' if NF icons aren't on.
commitHashLength: 8
diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go
index 26d10f73a..522a4f234 100644
--- a/pkg/config/user_config.go
+++ b/pkg/config/user_config.go
@@ -125,10 +125,6 @@ type GuiConfig struct {
NerdFontsVersion string `yaml:"nerdFontsVersion" jsonschema:"enum=2,enum=3,enum="`
// If true (default), file icons are shown in the file views. Only relevant if NerdFontsVersion is not empty.
ShowFileIcons bool `yaml:"showFileIcons"`
- // Whether to show full author names or their shortened form in the commit graph.
- // One of 'auto' (default) | 'full' | 'short'
- // If 'auto', initials will be shown in small windows, and full names - in larger ones.
- CommitAuthorFormat string `yaml:"commitAuthorFormat" jsonschema:"enum=auto,enum=short,enum=full"`
// Length of commit hash in commits view. 0 shows '*' if NF icons aren't on.
CommitHashLength int `yaml:"commitHashLength" jsonschema:"minimum=0"`
// If true, show commit hashes alongside branch names in the branches view.
@@ -687,7 +683,6 @@ func GetDefaultConfig() *UserConfig {
UnstagedChangesColor: []string{"red"},
DefaultFgColor: []string{"default"},
},
- CommitAuthorFormat: "auto",
CommitLength: CommitLengthConfig{Show: true},
SkipNoStagedFilesWarning: false,
ShowListFooter: true,
diff --git a/pkg/config/user_config_validation.go b/pkg/config/user_config_validation.go
index ed248fc44..403119ada 100644
--- a/pkg/config/user_config_validation.go
+++ b/pkg/config/user_config_validation.go
@@ -7,11 +7,6 @@ import (
)
func (config *UserConfig) Validate() error {
- if err := validateEnum("gui.commitAuthorFormat", config.Gui.CommitAuthorFormat,
- []string{"auto", "short", "full"}); err != nil {
- return err
- }
-
if err := validateEnum("gui.statusPanelView", config.Gui.StatusPanelView,
[]string{"dashboard", "allBranchesLog"}); err != nil {
return err
diff --git a/pkg/gui/presentation/commits.go b/pkg/gui/presentation/commits.go
index d8e1a45ce..c385d3407 100644
--- a/pkg/gui/presentation/commits.go
+++ b/pkg/gui/presentation/commits.go
@@ -440,14 +440,9 @@ func displayCommit(
mark = fmt.Sprintf("%s ", willBeRebased)
}
- var authorFunc func(string) string
- switch common.UserConfig.Gui.CommitAuthorFormat {
- case "short":
- authorFunc = authors.ShortAuthor
- case "full":
+ authorFunc := authors.ShortAuthor
+ if fullDescription {
authorFunc = authors.LongAuthor
- default:
- authorFunc = lo.Ternary(fullDescription, authors.LongAuthor, authors.ShortAuthor)
}
cols := make([]string, 0, 7)
diff --git a/schema/config.json b/schema/config.json
index daaf4ada6..77a16099f 100644
--- a/schema/config.json
+++ b/schema/config.json
@@ -332,16 +332,6 @@
"description": "If true (default), file icons are shown in the file views. Only relevant if NerdFontsVersion is not empty.",
"default": true
},
- "commitAuthorFormat": {
- "type": "string",
- "enum": [
- "auto",
- "short",
- "full"
- ],
- "description": "Whether to show full author names or their shortened form in the commit graph.\nOne of 'auto' (default) | 'full' | 'short'\nIf 'auto', initials will be shown in small windows, and full names - in larger ones.",
- "default": "auto"
- },
"commitHashLength": {
"type": "integer",
"minimum": 0,