Skip to content

Allow removing lines from patch directly#5277

Open
jesseduffield wants to merge 1 commit intomasterfrom
remove-lines-from-patch-directly
Open

Allow removing lines from patch directly#5277
jesseduffield wants to merge 1 commit intomasterfrom
remove-lines-from-patch-directly

Conversation

@jesseduffield
Copy link
Owner

@jesseduffield jesseduffield commented Feb 7, 2026

I always press 'd' in the patch building view, expecting that I can do exactly what I can do in the staging view, to find out I need to go space -> ctrl+p -> d and I think it's time to honour the muscle memory and support this convenience keybinding. I recall we may have had a debate about this in the past and if so I'm renewing my stance.

PR Description

Please check if the PR fulfills these requirements

  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

Copilot AI review requested due to automatic review settings February 7, 2026 22:05
@jesseduffield jesseduffield force-pushed the remove-lines-from-patch-directly branch from 9775c4e to 590719d Compare February 7, 2026 22:06
@jesseduffield jesseduffield requested review from stefanhaller and removed request for Copilot February 7, 2026 22:06
@jesseduffield jesseduffield added the enhancement New feature or request label Feb 7, 2026
@codacy-production
Copy link

codacy-production bot commented Feb 7, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 1d0db511 88.71%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (1d0db51) Report Missing Report Missing Report Missing
Head commit (81c96ef) 59747 52074 87.16%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#5277) 124 110 88.71%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@jesseduffield jesseduffield force-pushed the remove-lines-from-patch-directly branch from 590719d to 15e3017 Compare February 7, 2026 22:15
Copilot AI review requested due to automatic review settings February 7, 2026 22:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for using the universal remove keybinding (typically d) in the patch building view to remove selected lines directly from a commit (mirroring staging view muscle memory), backed by new i18n strings, docs updates, and an integration test.

Changes:

  • Add d/Universal.Remove keybinding in patch building view to remove selected lines from the commit via interactive rebase.
  • Introduce new i18n strings for the new action (labels, tooltips, prompts, disabled reasons).
  • Add an integration test and update generated keybindings docs accordingly.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pkg/gui/controllers/patch_building_controller.go Adds Universal.Remove binding, disabled-reason logic, confirmation flow, and rebase-backed removal implementation.
pkg/i18n/english.go Adds translation keys/strings for the new remove-lines-from-commit action and related errors/tooltips.
pkg/integration/tests/patch_building/remove_lines_from_commit.go New integration test covering d in patch building view to remove a selected line from a commit.
pkg/integration/tests/test_list.go Registers the new integration test.
docs-master/keybindings/Keybindings_*.md Updates generated keybindings docs to include the new d action in patch building view across languages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

I always press 'd' in the patch building view, expecting that I can do
exactly what I can do in the staging view, to find out I need to go
space -> ctrl+p -> d and I think it's time to honour the muscle memory
and support this convenience keybinding.
@jesseduffield jesseduffield force-pushed the remove-lines-from-patch-directly branch from 15e3017 to 81c96ef Compare February 7, 2026 22:28
@stefanhaller
Copy link
Collaborator

Great, you beat me to it. I have had this on my todo list for quite a while.

It might take me a while to review it, I'm busy right now with work and private stuff, but I'll get to it eventually (and the other two PRs). Looking forward to using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments