Skip to content

feat: gitignore range select - #5860

Open
phanen wants to merge 3 commits into
jesseduffield:masterfrom
phanen:feat/ignore-range
Open

feat: gitignore range select#5860
phanen wants to merge 3 commits into
jesseduffield:masterfrom
phanen:feat/ignore-range

Conversation

@phanen

@phanen phanen commented Jul 25, 2026

Copy link
Copy Markdown
Contributor
  • Refactor Ignore/Exclude to accept multiple filenames
  • Support multi-select for ignore/exclude file binding
  • Fix multi-select ignore/exclude for tracked ranges

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

phanen added 3 commits July 25, 2026 21:43
The gitignore-applier layer now takes a slice, looping over paths. The
files_controller plumbing still feeds a single-element slice so behavior
is unchanged for the single-file case; this prepares for wiring the
binding up to multi-select.
The `i` keybinding in the files panel now accepts a range selection of
nodes: every selected file is unstaged, removed from the index if it
was tracked, and appended to `.gitignore` (or `.git/info/exclude` on
the other menu entry) on its own line.

Plumbing switched from a single node to a slice of nodes so the tracked
/untracked split unstage-and-rm each path before writing the list.
The single-file path keeps the existing `.gitignore`-self-ignore guard.
A range select that crosses a tracked directory boundary breaks
because `git rm -r --cached -- dir` removes its descendants from the
index, so a subsequent child-targeted call fails with pathspec errors.
Untracked nodes in a mixed range hit the same problem since they
aren't in the index at all. Filter the selection through
`normalisedSelectedNodes` and only unstage/rm the nodes that are
actually tracked.
@phanen
phanen force-pushed the feat/ignore-range branch from f2b1348 to 6905d62 Compare July 25, 2026 16:24
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.

1 participant