REVENG named-path commit (L38 / L49)
Overview
On a shared dirty worktree, only stage exact paths you intend to ship. Bare
git add -A / git add . and cross-worktree git stash have deleted real work.
Rules
Stage by path only
git add -- path/one.py path/two.mdNever:
git add -A,git add .,git add -uwithout an explicit path list.Verify staged set BEFORE commit
git diff --cached --name-statusMust equal the intended set. Abort if you see unexpected
D/A/M.Windows hooks — When pre-commit needs
/c/Users/.../python, prefer Windowspwsh.exe+ Windows git from the worktree. Do notsudobind/mnt/c→/c(hangs). REQUIRED SUB-SKILL:wsl-windows-git-hooks.No
git stashacross worktrees — stash refs are global. Isolate with named-path stage only; leave others’ files unstaged.Hung
git statuson DrvFS — use a temp index if needed:export GIT_INDEX_FILE=$(mktemp) git read-tree HEAD git add -- <exact paths> git diff --cached --name-status # commit, then unset GIT_INDEX_FILE / remove tempOr use
bash scripts/git_status_scoped.shfor scoped status.Commit messages (L56) — Prefer
git commit -F msg.txtover PowerShell→bash nested heredocs (bash -lc 'git commit -m "$(cat <<EOF"'mangled quoting / exit 127 on Wave 10 tip1). Write the message file, commit, delete the temp msg file.
Pre-commit gate
- [ ] Intended paths listed explicitly
- [ ] git diff --cached --name-status == intended (no surprise D/A/M)
- [ ] No stash used to “clear the tree”
- [ ] If hooks need Windows Python → pwsh.exe path (not /c bind-mount)
Anti-patterns
| Excuse | Reality |
|---|---|
"git add -A then unstage theirs" |
Easy to miss a D. Named-path only. |
| "Stash theirs, commit mine, pop" | Stash is global across worktrees — you can take another agent’s stash. |
| "Status hung, so commit blind" | Temp GIT_INDEX_FILE or scoped status first. |
| "Hooks hung — skip with --no-verify" | Use Windows pwsh git; don’t skip hooks. |
Receipt (why this skill exists)
tip1 dirty-index accident deleted macos-slim + MCP tests from the index; restored from the prior SHA. Named-path + cached name-status would have aborted.
Cross-refs
- Sol tip loop:
reveng-sol-frozen-tip - Release honesty:
reveng-release-honesty - Pins: references/pins.md