jesseduffield / jesseduffield/lazygit
Ask if user wants to create empty commit when there are no staged changes
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
**Is your feature request related to a problem? Please describe.**
I've got a custom command configured for adding an empty commit. Empty commits have a few uses. One of them is to create a conventional commit for the sake of an automated version bump.
Currently, when you press 'c' in the files panel and there are no staged changes, you get an error popup saying that there are no staged changes. Instead, I want to use a confirmation prompt, telling the user 'There are no staged changes. Would you like to create an empty commit?' where if the user says yes, it brings up the commit message panel as usual and upon pressing enter we create an empty commit with the given commit message.
**Describe alternatives you've considered**
The two obvious alternatives are:
* using a custom command
* having a built-in keybinding for creating an empty commit
The built-in keybinding approach does give you a little more control i.e. for when you actually do have staged changes but you want to create an empty commit anyway. Perhaps down the line we can add such a keybinding but I think the above feature idea still makes sense, and is orthogonal.
Contributor guide
Assessment
This issue has not been assessed yet.