mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
Use conditional go template, to write the scope of the commit so the user, just needs to type the scope, and make the breaking change a (yes/no) prompt instead of a input
parent
e9d9dcec3e
commit
00dab3aa2a
1 changed files with 10 additions and 5 deletions
|
@ -388,6 +388,7 @@ Prompts to follow the [conventional commits](https://www.conventionalcommits.org
|
|||
|
||||
```yaml
|
||||
customCommands:
|
||||
# retrieved from: https://github.com/jesseduffield/lazygit/wiki/Custom-Commands-Compendium#conventional-commit
|
||||
- key: "<c-v>"
|
||||
context: "global"
|
||||
description: "Create new conventional commit"
|
||||
|
@ -430,13 +431,17 @@ customCommands:
|
|||
description: "Adding missing tests or correcting existing tests"
|
||||
value: "test"
|
||||
- type: "input"
|
||||
title: "Scope - Add '(<scope>)'"
|
||||
title: "Scope"
|
||||
key: "Scope"
|
||||
initialValue: ""
|
||||
- type: "input"
|
||||
title: "Breaking change - Add '!'"
|
||||
- type: "menu"
|
||||
key: "Breaking"
|
||||
initialValue: ""
|
||||
title: "Breaking change"
|
||||
options:
|
||||
- name: "no"
|
||||
value: ""
|
||||
- name: "yes"
|
||||
value: "!"
|
||||
- type: "input"
|
||||
title: "message"
|
||||
key: "Message"
|
||||
|
@ -445,7 +450,7 @@ customCommands:
|
|||
key: "Confirm"
|
||||
title: "Commit"
|
||||
body: "Are you sure you want to commit?"
|
||||
command: "git commit --message '{{.Form.Type}}{{.Form.Scope}}{{.Form.Breaking}}: {{.Form.Message}}'"
|
||||
command: "git commit --message '{{.Form.Type}}{{ if .Form.Scope }}({{ .Form.Scope }}){{ end }}{{.Form.Breaking}}: {{.Form.Message}}'"
|
||||
loadingText: "Creating conventional commit..."
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue