Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions docs/Config.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ This is only meant as a reference for what config options exist, and what their
```yaml
# Config relating to the Lazygit UI
gui:
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-author-color
authorColors: {}

# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-branch-color
# Deprecated: use branchColorPatterns instead
branchColors: {}

# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-branch-color
branchColorPatterns: {}

# The number of lines you scroll by when scrolling the main window
scrollHeight: 2

Expand Down Expand Up @@ -341,12 +351,21 @@ git:
# Deprecated: Use `allBranchesLogCmds` instead.
allBranchesLogCmd: git log --graph --all --color=always --abbrev-commit --decorate --date=relative --pretty=medium

# Commands used to display git log of all branches in the main window, they will be cycled in order of appearance (array of strings)
allBranchesLogCmds: []

# If true, do not spawn a separate process when using GPG
overrideGpg: false

# If true, do not allow force pushes
disableForcePushing: false

# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#predefined-commit-message-prefix
commitPrefix: []

# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#predefined-commit-message-prefix
commitPrefixes: {}

# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#predefined-branch-name-prefix
branchPrefix: ""

Expand Down Expand Up @@ -459,6 +478,13 @@ os:
# If true, don't display introductory popups upon opening Lazygit.
disableStartupPopups: false

# User-configured commands that can be invoked from within Lazygit
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Command_Keybindings.md
customCommands: []

# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-pull-request-urls
services: {}

# What to do when opening Lazygit outside of a git repo.
# - 'prompt': (default) ask whether to initialize a new repo or open in the most recent repo
# - 'create': initialize a new repo
Expand Down
3 changes: 2 additions & 1 deletion pkg/config/user_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type UserConfig struct {
// If true, don't display introductory popups upon opening Lazygit.
DisableStartupPopups bool `yaml:"disableStartupPopups"`
// User-configured commands that can be invoked from within Lazygit
// See https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Command_Keybindings.md
CustomCommands []CustomCommand `yaml:"customCommands" jsonschema:"uniqueItems=true"`
// See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-pull-request-urls
Services map[string]string `yaml:"services"`
Expand Down Expand Up @@ -252,7 +253,7 @@ type GitConfig struct {
// Command used to display git log of all branches in the main window.
// Deprecated: Use `allBranchesLogCmds` instead.
AllBranchesLogCmd string `yaml:"allBranchesLogCmd"`
// Commands used to display git log of all branches in the main window, they will be cycled in order of appearance
// Commands used to display git log of all branches in the main window, they will be cycled in order of appearance (array of strings)
AllBranchesLogCmds []string `yaml:"allBranchesLogCmds"`
// If true, do not spawn a separate process when using GPG
OverrideGpg bool `yaml:"overrideGpg"`
Expand Down
14 changes: 4 additions & 10 deletions pkg/jsonschema/generate_config_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,6 @@ func recurseOverSchema(rootSchema, schema *jsonschema.Schema, parent *Node) {
for pair := schema.Properties.Oldest(); pair != nil; pair = pair.Next() {
subSchema := getSubSchema(rootSchema, schema, pair.Key)

// Skip empty objects
if subSchema.Type == "object" && subSchema.Properties == nil {
continue
}

// Skip empty arrays
if isZeroValue(subSchema.Default) && subSchema.Type == "array" {
continue
}

node := Node{
Name: pair.Key,
Description: subSchema.Description,
Expand All @@ -235,6 +225,10 @@ func getZeroValue(val any, t string) any {
return ""
case "boolean":
return false
case "object":
return map[string]any{}
case "array":
return []any{}
default:
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions schema/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@
"type": "string"
},
"type": "array",
"description": "Commands used to display git log of all branches in the main window, they will be cycled in order of appearance"
"description": "Commands used to display git log of all branches in the main window, they will be cycled in order of appearance (array of strings)"
},
"overrideGpg": {
"type": "boolean",
Expand Down Expand Up @@ -1838,7 +1838,7 @@
},
"type": "array",
"uniqueItems": true,
"description": "User-configured commands that can be invoked from within Lazygit"
"description": "User-configured commands that can be invoked from within Lazygit\nSee https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Command_Keybindings.md"
},
"services": {
"additionalProperties": {
Expand Down