jesseduffield / lazygit

simple terminal UI for git commands
MIT License
52.15k stars 1.82k forks source link

Add option to create fixup! commit with message #3962

Open NikolaiDokken opened 2 weeks ago

NikolaiDokken commented 2 weeks ago

Is your feature request related to a problem? Please describe. I usually use fixup! commits to make changes in response to PR comments. In these cases it would be nice to be able to add a message to the fixup! commit so that reviewers can look at a specific commit for the new changes.

Describe the solution you'd like I want to add an option in the "Create fixup commit"-modal that allows me to add a message to my fixup! commit. It could say "fixup! commit with message".

Describe alternatives you've considered I usually use command line to add message to fixup! commits using the -m flag

Additional context This is where the new option "fixup! commit with message" should reside

image
stefanhaller commented 1 week ago

I have the same need, and I solve this by doing shift-F, enter normally, and then rewording the created fixup commit using r afterwards.

Yes, it's a little more work, but not terribly so. I am a little reluctant to add a new command for this, because I find the use of the commit message panel confusing in this case. What you type into the subject field of that panel will end up in the body of the fixup commit (and in your PR you ignore the description field altogether, so what if you want to have a multi-line message body?).

Also, for amend! commits we bring up the commit message panel too, but in that case it acts more like a reword command, and the typed subject and description will both end up in the body of the amend commit. For fixup commits that wouldn't be quite the same, and I don't really have a good idea how to make this consistent.

To sum it up, I'd rather live with the little bit of extra work on the user's side, than to make things confusing and hard to understand.