Skip to content

Support fixup with keeping the message of the selected commit #4526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

stefanhaller
Copy link
Collaborator

  • PR Description

@jesseduffield in #4514:

Right now you're able to fixup a commit down into the commit below. That is, you combine the two commits and retain the message of the lower commit. However, often I find myself wanting to preserve the message of the higher commit.

This PR makes this possible by replacing the confirmation with a menu that asks the user which commit message to retain.

Fixes #4514.

@stefanhaller
Copy link
Collaborator Author

This is a draft PR because I'm not convinced about the UI yet, the strings are not i18n'ed, and there are no tests.

Also, in an interactive rebase I added a preliminary visualization of which way the fixup goes (fixup↓ for the normal case, fixup← for when we retain the message of the commit that is squashed down. I don't like this very much, but I do feel it would be good to visualize this somehow.

@jesseduffield
Copy link
Owner

Nice, I'll give this branch a go and see how I find it

This is true for Fixup todos that have their -C flag set.
We show fixup↓ for the normal case where the commit message of the bottom commit
is retained, and fixup← for the special case where the message of the upper
commit is used (e.g. for 'amend!' commits).
Not used yet, we pass an empty string everywhere, to match the previous
behavior. Just extracting this into a separate commit to make the next one
smaller.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to fixup into the above commit
2 participants