You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Renames aren't detected when the new file is untracked #243
#223 made renames render against their origin for tracked-vs-tracked diffs (staged, single-ref, two-ref). But when a file is renamed in the working tree without staging, the new path is untracked, and revdiff shows the old file as a full deletion plus the new file as an all-+ add instead of pairing them as a rename.
Repro
mv README.md README2.md # rename in the working tree, leaving README2.md untracked
revdiff --untracked
Expected: one rename entry, README.md → README2.md. Actual: README.md deleted + README2.md all-+ new file. Staging the rename and using --staged renders correctly, so it's specific to the untracked path.
Staged
Unstaged
Cause
Untracked files are diffed independently against /dev/null, so the new file never shares a git diff invocation with the deleted origin and -M has nothing to pair.
Potential Fix
I experimented a bit with Claude Code, and it came up with a slightly hacky way to fix this. However, I'm not familiar with the codebase here, so I can't say whether or not it's a good idea or there's a better approach. 🙂
Marking the untracked file intent-to-add puts it in the same diff, and -M pairs the rename:
Activity
fix: detect renames when the new file is untracked (#246)
LandonSchropp commentedon Jul 1, 2026
@umputun Thank you!