gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

Feature Request: Setting to start a commit with no changes selected (v3?)

Open JackMyers001 opened this issue 7 months ago • 3 comments

Currently (at least in v3 UI), pressing the "Start a commit..." button will select all uncommitted changes to be added to the commit.

On at least two occasions, I have accidentally added more to my commit than intended because all the files were selected. Thankfully, it's very easy to fix this up with GitButler 😀, but I'd love a setting to have no files be selected when starting a commit, forcing me to manually select the files / sections of files I'd like to add.

JackMyers001 avatar May 14 '25 07:05 JackMyers001

Thanks so much for bringing this up!

Normally one could say that creating empty commits isn't anything one would do in Git, but in GitButler it's a normal part of the workflow as commits are more like buckets.

Thus I think it makes sense to not only accommodate the "want to commit everything" workflow, but to find a way to create (possibly empty, or partial) commits that have their commit message already set.

Let's CC @PavelLaptev and @krlvi to figure out if that could be done, and maybe even how.

Byron avatar May 14 '25 08:05 Byron

Just to clarify - I'm not suggesting anything about creating empty commits (though I can see a use for this... 🤔)

The feature I'd like to see implemented is a setting that changes the behaviour for when a user begins the process of creating a commit - instead of having every file selected (staged?) right at the start, it would be more like a traditional Git workflow where you need to git add each file (or stage hunks of a file). This is also more similar to other Git GUI programs, where you need to add/stage the files you want to add to the commit.

JackMyers001 avatar May 14 '25 13:05 JackMyers001

The feature I'd like to see implemented is a setting that changes the behaviour for when a user begins the process of creating a commit - instead of having every file selected (staged?) right at the start, it would be more like a traditional Git workflow where you need to git add each file (or stage hunks of a file). This is also more similar to other Git GUI programs, where you need to add/stage the files you want to add to the commit.

I see, and suppose I jumped ahead a bit and assumed that when starting without any selection, it would be useful to be able to create an empty commit as well (while at it). For now the 'staging' in the UI is in-memory only and won't affect the git index/staging area, but maybe that's an area where useful workflows can be developed around at some point.

Byron avatar May 14 '25 14:05 Byron