-
-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Problem
Pre-commit's git stash push/pop cycle corrupted 6 working tree files with merge conflict markers during the #2383 commit. The committed content was correct (hooks passed), but the unstaged working copies had <<<<<<< HEAD conflicts requiring manual resolution.
Discovered During
Committing #2383 — after successful commit, agent_seeder.py, slm_client.py, manager.py, model_constants.py, seed_agents.py, and ssot_config.py all had conflict markers in the working tree.
Root Cause
Known issue #1503 (pre-commit stash risk). The PostToolUse hook (Black + isort) modifies files between the pre-commit stash push and pop, causing the pop to conflict.
Workaround Applied
git checkout HEAD -- <files> to restore committed versions.
Proposed Fix
Add a post-commit hook or adjust the PostToolUse hook workflow:
- After commit success, run
git checkout HEAD -- $(git diff --name-only)to auto-heal - Or: disable the PostToolUse auto-format hook and rely solely on pre-commit hooks
Related
#1503 (pre-commit stash risk documentation)
Impact
Medium — requires manual cleanup after every commit that touches files also modified by PostToolUse hook.