Problem
With shiv:notes 0.8.19, committing a staged readable note can fail during pre-commit auto-obfuscation when the mapped obfuscated path is marked skip-worktree by the deobfuscated checkout.
Observed sequence:
-
Modify notes/Status.md in an unlocked/deobfuscated home.
-
Run notes stage notes/Status.md.
-
Run git commit.
-
The pre-commit hook reports Auto-obfuscating 1 file(s)..., writes the mapped obfuscated file, then git add fails with:
The following paths and/or pathspecs matched paths that exist
outside of your sparse-checkout definition, so will not be
updated in the index:
notes/1474d5a8
The repository was not using sparse checkout (git sparse-checkout list reported that this worktree is not sparse), but git ls-files -v showed the obfuscated path with the S skip-worktree flag.
The failed hook left an interrupted state:
notes status then correctly warned that Status.md was double-tracked as both readable and obfuscated.
Recovery used
git rm --cached --ignore-unmatch notes/Status.md
git update-index --no-skip-worktree notes/1474d5a8
git add notes/1474d5a8
git commit
The note content was preserved, and the repository was subsequently merged and pushed cleanly.
Expected
Auto-obfuscation should stage its mapped obfuscated path even when that path was intentionally marked skip-worktree by deobfuscation. Possible fixes include clearing the flag before staging or using the appropriate sparse-aware git add path. A failed hook should ideally restore or clearly guide recovery from the readable-path staging state.
Problem
With
shiv:notes 0.8.19, committing a staged readable note can fail during pre-commit auto-obfuscation when the mapped obfuscated path is marked skip-worktree by the deobfuscated checkout.Observed sequence:
Modify
notes/Status.mdin an unlocked/deobfuscated home.Run
notes stage notes/Status.md.Run
git commit.The pre-commit hook reports
Auto-obfuscating 1 file(s)..., writes the mapped obfuscated file, thengit addfails with:The repository was not using sparse checkout (
git sparse-checkout listreported that this worktree is not sparse), butgit ls-files -vshowed the obfuscated path with theSskip-worktree flag.The failed hook left an interrupted state:
notes statusthen correctly warned thatStatus.mdwas double-tracked as both readable and obfuscated.Recovery used
The note content was preserved, and the repository was subsequently merged and pushed cleanly.
Expected
Auto-obfuscation should stage its mapped obfuscated path even when that path was intentionally marked skip-worktree by deobfuscation. Possible fixes include clearing the flag before staging or using the appropriate sparse-aware
git addpath. A failed hook should ideally restore or clearly guide recovery from the readable-path staging state.