mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Revert "Add user config gui.commitAuthorFormat (#3625)"
This reverts commit3af545daf7
, reversing changes made to629b7ba1b8
. We changed our mind about this and want to provide different options for achieving the same thing, but with more flexibility.
This commit is contained in:
parent
5dbdbd8425
commit
7be82d4713
5 changed files with 2 additions and 32 deletions
|
@ -185,11 +185,6 @@ gui:
|
||||||
# If true (default), file icons are shown in the file views. Only relevant if NerdFontsVersion is not empty.
|
# If true (default), file icons are shown in the file views. Only relevant if NerdFontsVersion is not empty.
|
||||||
showFileIcons: true
|
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.
|
# Length of commit hash in commits view. 0 shows '*' if NF icons aren't on.
|
||||||
commitHashLength: 8
|
commitHashLength: 8
|
||||||
|
|
||||||
|
|
|
@ -125,10 +125,6 @@ type GuiConfig struct {
|
||||||
NerdFontsVersion string `yaml:"nerdFontsVersion" jsonschema:"enum=2,enum=3,enum="`
|
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.
|
// If true (default), file icons are shown in the file views. Only relevant if NerdFontsVersion is not empty.
|
||||||
ShowFileIcons bool `yaml:"showFileIcons"`
|
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.
|
// Length of commit hash in commits view. 0 shows '*' if NF icons aren't on.
|
||||||
CommitHashLength int `yaml:"commitHashLength" jsonschema:"minimum=0"`
|
CommitHashLength int `yaml:"commitHashLength" jsonschema:"minimum=0"`
|
||||||
// If true, show commit hashes alongside branch names in the branches view.
|
// If true, show commit hashes alongside branch names in the branches view.
|
||||||
|
@ -687,7 +683,6 @@ func GetDefaultConfig() *UserConfig {
|
||||||
UnstagedChangesColor: []string{"red"},
|
UnstagedChangesColor: []string{"red"},
|
||||||
DefaultFgColor: []string{"default"},
|
DefaultFgColor: []string{"default"},
|
||||||
},
|
},
|
||||||
CommitAuthorFormat: "auto",
|
|
||||||
CommitLength: CommitLengthConfig{Show: true},
|
CommitLength: CommitLengthConfig{Show: true},
|
||||||
SkipNoStagedFilesWarning: false,
|
SkipNoStagedFilesWarning: false,
|
||||||
ShowListFooter: true,
|
ShowListFooter: true,
|
||||||
|
|
|
@ -7,11 +7,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (config *UserConfig) Validate() error {
|
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,
|
if err := validateEnum("gui.statusPanelView", config.Gui.StatusPanelView,
|
||||||
[]string{"dashboard", "allBranchesLog"}); err != nil {
|
[]string{"dashboard", "allBranchesLog"}); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -440,14 +440,9 @@ func displayCommit(
|
||||||
mark = fmt.Sprintf("%s ", willBeRebased)
|
mark = fmt.Sprintf("%s ", willBeRebased)
|
||||||
}
|
}
|
||||||
|
|
||||||
var authorFunc func(string) string
|
authorFunc := authors.ShortAuthor
|
||||||
switch common.UserConfig.Gui.CommitAuthorFormat {
|
if fullDescription {
|
||||||
case "short":
|
|
||||||
authorFunc = authors.ShortAuthor
|
|
||||||
case "full":
|
|
||||||
authorFunc = authors.LongAuthor
|
authorFunc = authors.LongAuthor
|
||||||
default:
|
|
||||||
authorFunc = lo.Ternary(fullDescription, authors.LongAuthor, authors.ShortAuthor)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cols := make([]string, 0, 7)
|
cols := make([]string, 0, 7)
|
||||||
|
|
|
@ -332,16 +332,6 @@
|
||||||
"description": "If true (default), file icons are shown in the file views. Only relevant if NerdFontsVersion is not empty.",
|
"description": "If true (default), file icons are shown in the file views. Only relevant if NerdFontsVersion is not empty.",
|
||||||
"default": true
|
"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": {
|
"commitHashLength": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"minimum": 0,
|
"minimum": 0,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue