-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Support using the selected commit's message in a fixup #5233
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
base: master
Are you sure you want to change the base?
Conversation
b6121f7 to
15e0386
Compare
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesFootnotes
|
stefanhaller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is similar to #4526 in many ways, except for the addition of the extra c command, which is a great idea.
My main problem with #4526 was that I found the new fixup menu (outside of rebase) more confusing than the old confirmation, so it slowed me down even though the muscle memory interaction stayed the same; that's probably better in your version because the top menu entry simply says "Fixup", which I like. I'll use this in production for a while and see how it feels.
I didn't look at the code very much yet, just a little bit of early feedback about the texts.
docs/Config.md
Outdated
| renameCommitWithEditor: R | ||
| viewResetOptions: g | ||
| markCommitAsFixup: f | ||
| setFixupMessage: M |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious where the changes to docs/ come from; did you add them manually somehow? make generate only touches docs-master/, which is all we want to change. I pushed 7ae2965 to fix this, just wondering if we have a problem with our tooling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's on me: mustn't have been paying attention. I've confirmed go generate ./... does not update those files.
pkg/i18n/english.go
Outdated
| Fixup: "Fixup", | ||
| SureFixupThisCommit: "Are you sure you want to 'fixup' the selected commit(s) into the commit below?", | ||
| FixupKeepMessage: "Fixup and use this commit's message", | ||
| FixupKeepMessageTooltip: "Meld the selected commit into the commit below, using this commit's message.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Meld" reads really weird to me; the standard term for this is "squash". I realize we already use "Meld" on main in the FixupTooltip text, but there's a reason in that case, because that text also mentions the 'squash' command, so it uses another term to avoid confusion; we don't have this problem here, so I'd prefer to say "Squash" in this case.
Also, I wonder if we should be even more explicit and say "using this commit's message, discarding the message of the commit below." Maybe that's over the top, but the extra clarity could be helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me. See dad04be (this PR)
I've optimised for muscle memory backwards compatibility here: - Outside interactive rebase: press 'f' then instead of a confirmation panel, a menu appears where you can choose to keep the selected commit's message - Inside interactive rebase: press 'f' then press 'c' to see the menu for keeping the message, where if you press 'c' again it will retain the current message. so 'fcc' is the chord to press. We're also now showing the -C flag (which is what enables the behaviour) against the todo. I've picked the 'c' keybinding because 'C' was taken and it corresponds to the flag. Previously that showed a warning about a change in keybinding for cherry picking but it's been ages since we've made that change so I'm happy to retire it.
7ae2965 to
dad04be
Compare
PR Description
I had a spare couple hours so figured I'd whip up a PR for a feature I've wanted for a while.
I've optimised for muscle memory backwards compatibility here:
We're also now showing the -C flag (which is what enables the behaviour) against the todo.
I've picked the 'c' keybinding because 'C' was taken and it corresponds to the flag. Previously that showed a warning about a change in keybinding for cherry picking but it's been ages since we've made that change so I'm happy to retire it.
Please check if the PR fulfills these requirements
go generate ./...)