diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2024-06-15 16:17:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-15 16:17:48 +0200 |
commit | 3af545daf7cf6458e8efd324012047ce688f08e6 (patch) | |
tree | f7daa6c38743234665b1e1489131f9bb76364695 /pkg/config | |
parent | 629b7ba1b8f634c26adad43ffe44ed601d652f0c (diff) | |
parent | 57f9493770f91c573bdf0f4aecf034755acbf7e8 (diff) |
- **PR Description**
Adds configuration option defining whether to show full author names or
their shortened form in the commit graph.
Closes [#3624](https://github.com/jesseduffield/lazygit/issues/3624).
- **Please check if the PR fulfills these requirements**
* [x] Cheatsheets are up-to-date (run `go generate ./...`)
* [x] Code has been formatted (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting))
* [ ] Tests have been added/updated (see
[here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md)
for the integration test guide)
* [ ] Text is internationalised (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation))
* [x] Docs have been updated if necessary
* [x] You've read through your own file changes for silly mistakes etc
Diffstat (limited to 'pkg/config')
-rw-r--r-- | pkg/config/user_config.go | 5 | ||||
-rw-r--r-- | pkg/config/user_config_validation.go | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go index c8895710e..47fbe2eea 100644 --- a/pkg/config/user_config.go +++ b/pkg/config/user_config.go @@ -125,6 +125,10 @@ 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. @@ -676,6 +680,7 @@ 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 403119ada..ed248fc44 100644 --- a/pkg/config/user_config_validation.go +++ b/pkg/config/user_config_validation.go @@ -7,6 +7,11 @@ 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 |