Skip to content

Commit 635bc7d

Browse files
committed
Add 'ShowCommitTags' configuration option
When working on projects that make heavy use of tags (ie. every commit has multiple tags), it would be nice to be able to hide commit tags. This commit adds this option. Discussion with interest for the feature: #3294
1 parent aa331e5 commit 635bc7d

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

docs/Config.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ gui:
208208
# If true, show jump-to-window keybindings in window titles.
209209
showPanelJumps: true
210210

211+
# If true, show tags alognside commit summary in the commits view.
212+
showCommitTags: true
213+
211214
# Nerd fonts version to use.
212215
# One of: '2' | '3' | empty string (default)
213216
# If empty, do not show icons.

pkg/config/app_config_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,9 @@ gui:
520520
# Deprecated: use nerdFontsVersion instead
521521
showIcons: false
522522
523+
# If true, show tags alognside commit summary in the commits view.
524+
showCommitTags: true
525+
523526
# Nerd fonts version to use.
524527
# One of: '2' | '3' | empty string (default)
525528
# If empty, do not show icons.

pkg/config/user_config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ type GuiConfig struct {
137137
ShowPanelJumps bool `yaml:"showPanelJumps"`
138138
// Deprecated: use nerdFontsVersion instead
139139
ShowIcons bool `yaml:"showIcons" jsonschema:"deprecated"`
140+
// If true, show tags alognside commit summary in the commits view.
141+
ShowCommitTags bool `yaml:"showCommitTags"`
140142
// Nerd fonts version to use.
141143
// One of: '2' | '3' | empty string (default)
142144
// If empty, do not show icons.
@@ -770,6 +772,7 @@ func GetDefaultConfig() *UserConfig {
770772
ShowNumstatInFilesView: false,
771773
ShowRandomTip: true,
772774
ShowIcons: false,
775+
ShowCommitTags: true,
773776
NerdFontsVersion: "",
774777
ShowFileIcons: true,
775778
CommitAuthorShortLength: 2,

pkg/gui/presentation/commits.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,8 @@ func displayCommit(
396396
tagString = style.FgMagenta.SetBold().Sprint(commit.ExtraInfo) + " "
397397
}
398398
} else {
399-
if len(commit.Tags) > 0 {
399+
showTags := common.UserConfig().Gui.ShowCommitTags
400+
if showTags && len(commit.Tags) > 0 {
400401
tagString = theme.DiffTerminalColor.SetBold().Sprint(strings.Join(commit.Tags, " ")) + " "
401402
}
402403

schema/config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,11 @@
604604
"description": "Deprecated: use nerdFontsVersion instead",
605605
"default": false
606606
},
607+
"showCommitTags": {
608+
"type": "boolean",
609+
"description": "If true, show tags alognside commit summary in the commits view.",
610+
"default": true
611+
},
607612
"nerdFontsVersion": {
608613
"type": "string",
609614
"enum": [

0 commit comments

Comments
 (0)