Support using the selected commit's message in a fixup#5233
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.
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.
7ae2965 to
dad04be
Compare
It's been ages since we changed the key, users should hopefully be used to it by now, and we want to reuse the key for something else later in the branch. Co-authored-by: Stefan Haller <stefan@haller-berlin.de>
Co-authored-by: Stefan Haller <stefan@haller-berlin.de>
Co-authored-by: Stefan Haller <stefan@haller-berlin.de>
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. Co-authored-by: Stefan Haller <stefan@haller-berlin.de>
dad04be to
897e01b
Compare
stefanhaller
left a comment
There was a problem hiding this comment.
This is very nice; I used it for a while now, and have no issues with the workflow. I even used the feature of using the upper commit's message once, so that's a welcome improvement.
I took the liberty to break up the large commit into a few smaller ones, I find this much easier to review.
| Lines( | ||
| Contains("--- Pending rebase todos ---"), | ||
| Contains("pick").Contains("Third Commit"), | ||
| Contains("fixup").Contains("Second Commit").IsSelected(), |
There was a problem hiding this comment.
I usually prefer matching larger parts of a line instead of multiple Contains, mainly because it's more robust (you'd need a DoesNotContain("-C") in your version), but also because I find it easier to read.
Fixed in 897e01b.
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.
897e01b to
f317a97
Compare
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [jesseduffield/lazygit](https://github.com/jesseduffield/lazygit) | minor | `v0.58.1` → `v0.59.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>jesseduffield/lazygit (jesseduffield/lazygit)</summary> ### [`v0.59.0`](https://github.com/jesseduffield/lazygit/releases/tag/v0.59.0) [Compare Source](jesseduffield/lazygit@v0.58.1...v0.59.0) <!-- Release notes generated using configuration in .github/release.yml at v0.59.0 --> #### What's Changed ##### Enhancements 🔥 - Have "Find base commit for fixup" ignore fixup commits for the found base commit by [@​stefanhaller](https://github.com/stefanhaller) in [#​5210](jesseduffield/lazygit#5210) - Exclude commit trailers from line wrapping by [@​stefanhaller](https://github.com/stefanhaller) in [#​5230](jesseduffield/lazygit#5230) - Limit popup panel widths to a maximum width by [@​stefanhaller](https://github.com/stefanhaller) in [#​5231](jesseduffield/lazygit#5231) - Support using the selected commit's message in a fixup by [@​jesseduffield](https://github.com/jesseduffield) in [#​5233](jesseduffield/lazygit#5233) - Fix gitignore path collisions by [@​DawidPietrykowski](https://github.com/DawidPietrykowski) in [#​5245](jesseduffield/lazygit#5245) ##### Fixes 🔧 - Don't log the "git rev-list" call when marking bisect commits by [@​stefanhaller](https://github.com/stefanhaller) in [#​5236](jesseduffield/lazygit#5236) - Fix opening a menu when a previous menu was scrolled down by [@​stefanhaller](https://github.com/stefanhaller) in [#​5238](jesseduffield/lazygit#5238) - When moving commits up/down and the selection leaves the view, scroll to make it visible again by [@​stefanhaller](https://github.com/stefanhaller) in [#​5247](jesseduffield/lazygit#5247) - Fix rendering of CRLF sequence ('\r\n') by [@​stefanhaller](https://github.com/stefanhaller) in [#​5237](jesseduffield/lazygit#5237) - Fix rendering of the Reflog panel when using up/down to scroll it by [@​stefanhaller](https://github.com/stefanhaller) in [#​5248](jesseduffield/lazygit#5248) - Add Nushell support for nvim-remote preset by [@​baiyeidk](https://github.com/baiyeidk) in [#​5250](jesseduffield/lazygit#5250) ##### Maintenance ⚙️ - Update devcontainer `VARIANT` to `1-trixie` by [@​mricherzhagen](https://github.com/mricherzhagen) in [#​5204](jesseduffield/lazygit#5204) - chore: Update outdated GitHub Actions versions by [@​pgoslatara](https://github.com/pgoslatara) in [#​5220](jesseduffield/lazygit#5220) - Disable the automatic, scheduled release by [@​stefanhaller](https://github.com/stefanhaller) in [#​5272](jesseduffield/lazygit#5272) - Auto-update cheatsheets after updating translation by [@​stefanhaller](https://github.com/stefanhaller) in [#​5275](jesseduffield/lazygit#5275) ##### Docs 📖 - Update README to add GitArbor TUI as an alternative by [@​cadamsdev](https://github.com/cadamsdev) in [#​5257](jesseduffield/lazygit#5257) - Update docs and schema for release by [@​stefanhaller](https://github.com/stefanhaller) in [#​5276](jesseduffield/lazygit#5276) ##### I18n 🌎 - Update translations from Crowdin by [@​stefanhaller](https://github.com/stefanhaller) in [#​5274](jesseduffield/lazygit#5274) #### New Contributors - [@​pgoslatara](https://github.com/pgoslatara) made their first contribution in [#​5220](jesseduffield/lazygit#5220) - [@​cadamsdev](https://github.com/cadamsdev) made their first contribution in [#​5257](jesseduffield/lazygit#5257) - [@​baiyeidk](https://github.com/baiyeidk) made their first contribution in [#​5250](jesseduffield/lazygit#5250) **Full Changelog**: <jesseduffield/lazygit@v0.58.1...v0.59.0> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45Ni4yIiwidXBkYXRlZEluVmVyIjoiNDIuOTYuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->
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 ./...)