Skip to content

Add projectile-find-changed-file - #2134

Merged
bbatsov merged 1 commit into
masterfrom
feature/find-changed-file
Jul 28, 2026
Merged

Add projectile-find-changed-file#2134
bbatsov merged 1 commit into
masterfrom
feature/find-changed-file

Conversation

@bbatsov

@bbatsov bbatsov commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Jumping to a file you've been editing meant completing over every file in the
project. Git already knows the much shorter list, so s-p C completes over
that instead: staged, unstaged and untracked.

With a prefix argument it asks for a revision - completing over the project's
branches - and the candidates become everything that differs from it, plus
whatever isn't tracked yet. That's the "what did this branch touch" list.

Two things needed care, and both have specs against real git repositories
rather than canned output:

  • Git reports porcelain and diff paths relative to the repository root
    regardless of where it ran. A project sitting below that root would have got
    paths that don't resolve, so they're translated and anything outside the
    project is dropped.
  • A rename occupies two NUL-separated records - the new path and then the old
    one. Consuming them in step keeps the source path from reading as another
    changed file.

--untracked-files=all rather than the dashboard's normal, since here the
individual files under a new directory are the point.

The dashboard's git runner moves out of the dashboard so both can use it. It
was already shell-free and passing --no-optional-locks, so nothing about it
had to change.

One incidental fix: my first version of these specs wrote plain text into .el
files in test/sandbox/, which eldev then tries to load as test files on the
next run - the suite passed once and then failed. They write valid elisp now.

Jumping to something you've been editing meant completing over the whole
project and remembering the name. Git already knows the shorter list.

Without a prefix it's the working tree - staged, unstaged, untracked;
with one you pick a revision and get everything that differs from it,
which is the list you want when picking a branch back up.

Two things needed care. Git reports porcelain and diff paths relative to
the repository root no matter where it ran, so a project below that root
gets them translated and anything outside it dropped. And a rename
occupies two NUL-separated fields, so the source path has to be consumed
in step or it reads as another changed file.

The dashboard's git runner moves out of the dashboard to be shared; it
was already shell-free and careful not to take the index lock.
@bbatsov
bbatsov merged commit e52477a into master Jul 28, 2026
10 checks passed
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