Fix staging to bypass pre-commit blockers | Generated by AI
Done. Here’s what was changed and why:
Root cause: gitmessageai() did git add -A which stages ALL files in the repo. When pre-commit runs on git commit, it checks every staged file — if any unrelated file fails a hook, the commit dies.
Fix — 3 files changed:
-
ww/github/gitmessageai.py— addedfilesparameter. When provided, only stages those files (git add <file1> <file2>...) instead ofgit add -A. Falls back toadd -Awhenfiles=None(backward compatible). -
ww/note/note_workflow.py— passes[created_path]togitmessageai(files=...)so only the new note gets staged and committed. -
ww/note/note_queue_process.py— same fix:_git_commit_push(files=created_paths)passes the list of created note files through togitmessageai.
Before: git add -A → pre-commit runs on ALL repo files → fails on unrelated files
After: git add notes/2026-06-03-foo.md → pre-commit runs only on the note → clean commit
All other callers of gitmessageai (like ww git commit) still get files=None → git add -A, so no behavior change elsewhere.