dirty_tree: handle mixed real-vs-stat-stale modifications #76
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally filed by @coilysiren on 2026-04-28T06:11:09Z - https://github.com/coilysiren/repo-recall/issues/24
Follow-up to #22. The fix in 9081124 handles the all-stat-stale case: if
git diff --quietexits 0, drop every modified entry as phantom. But it doesn't handle the mixed case - some entries are real diffs, some are phantom. Theregit diff --quietexits non-zero (because of the real entries) and we keep the full count, including the phantoms.Real-world example from
~/projects/coilysiren/infrastructureon kai-server: 12 entries flagged modified, 3 are real (chmod 100644 -> 100755 on three .sh launchers), 9 are phantom-dirty (no diff output,git update-index --really-refreshdoesn't auto-resolve - probably CRLF / autocrlf / .gitattributes filter / filemode trust on a fresh-mounted volume). Today the dashboard says "12 modified files action required" when only 3 are real.Fix: enumerate the real ones with
git diff --name-only(and maybegit diff --cached --name-onlyfor staged), build a set, and only count modified entries whose path is in the set. Phantoms drop both from the count and from the path sample.Code site: same
worktree_snapshotinsrc/commits.rsthat #22 touched. Replace the all-or-nothingunstaged_diff_is_emptycheck with areal_modified_pathsset lookup.Cost: one extra subprocess per repo with modified entries (
git diff --name-only). Same magnitude as thegit diff --quietalready added.Out of scope: detecting why a file is phantom-dirty (CRLF vs filemode vs filter). That's a debugging tool, not a dashboard signal.