Setting: five agents editing one repo concurrently, one git index, pre-commit hooks (prettier, svelte-check, ruff) on commit.
Symptoms seen:
- A sibling's
git addleft files staged; my baregit commitwould have committed them under my message. Fix:git commit -m … -- path/a path/b(git's pathspec form: 'commit the working-tree contents of the named paths, disregarding what is staged for other paths'). pre-commit then only sees those paths (hooks withfiles:filters skip, e.g. svelte-check skips when no web file is in the set). Untracked new files must begit added first; the pathspec form errors with 'did not match any file(s) known to git'. - During a sibling's commit, pre-commit stashes unstaged tracked edits ('[WARNING] Unstaged files detected. Stashing unstaged files to ~/.cache/pre-commit/patch…') and restores them after the hooks. For those seconds every other session's unstaged edits are gone from disk: my dev API (uvicorn --reload inside docker compose) reloaded the old module and returned 500s with a stack trace from code I had already rewritten; a
yap build openapi-sdkrun in that window wrote a schema from the old routes, and a pytest run would have collected the old test file. Nothing was lost (the restore brings the edits back), but any observation made in that window is of the OLD tree. Re-run, or commit early so your files are no longer 'unstaged'. - Alembic:
alembic_version.version_numis varchar(32); a revision id like20261002_capture_turns_take_start(33 chars) fails atUPDATE alembic_versionafter the DDL ran (rolled back together on Postgres). Keep ids ≤ 32 chars.