jesseduffield / jesseduffield/lazygit

Ask if user wants to create empty commit when there are no staged changes

Open
#2,439 4 comments 3 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.