Repository navigation
Description
Summary
On Windows, graphify hook install (v0.4.2) writes post-commit and post-checkout hooks that hardcode python3 as their fallback interpreter. Windows Python installs use python (no python3 shim), so every commit and checkout produces:
.git/hooks/post-commit: line 32: python3: command not found
The hook runs as a silent no-op, so it's not fatal, but the knowledge graph never rebuilds — defeating the purpose of the hook install.
Root cause
The hooks try to sniff the Python interpreter from the graphify binary's shebang line:
GRAPHIFY_BIN=$(command -v graphify 2>/dev/null)
if [ -n "$GRAPHIFY_BIN" ]; then
_SHEBANG=$(head -1 "$GRAPHIFY_BIN" | sed 's/^#![[:space:]]*//')
...On Windows, graphify is a .exe wrapper (not a Python script with a shebang). head -1 of an .exe returns binary garbage starting with MZ, the allowlist filter rejects it, and the hook falls through to the hardcoded GRAPHIFY_PYTHON="python3" fallback. Since Windows doesn't have python3 on PATH, execution fails.
Repro
- Windows 10/11 with Python 3.x installed (so
pythonis on PATH butpython3is not) pip install graphifyycd some-repo && graphify hook install- Make any commit
- Observe:
python3: command not foundon stderr, no graph rebuild happens
Fix
Both post-commit and post-checkout hooks need a cross-platform fallback chain. Suggested patch:
# Fall back: try python3, then python (Windows), else abort silently
if [ -z "$GRAPHIFY_PYTHON" ]; then
if command -v python3 >/dev/null 2>&1 && python3 -c "import graphify" 2>/dev/null; then
GRAPHIFY_PYTHON="python3"
elif command -v python >/dev/null 2>&1 && python -c "import graphify" 2>/dev/null; then
GRAPHIFY_PYTHON="python"
else
# No usable Python interpreter — hook is a no-op on this machine
exit 0
fi
fiI've been running this patched version locally on a Windows wallnut project since 2026-04-12 without issues. Happy to submit a PR if it's useful.
Environment
- OS: Windows 11 (build via git-bash shell from Git for Windows)
- Python: 3.10.11 via
python(nopython3symlink) - graphify: 0.4.2
- Shell: bash 5.2 (git-bash MINGW64)
Workaround for affected users
Until a fix lands, patch your local .git/hooks/post-commit and .git/hooks/post-checkout to replace the GRAPHIFY_PYTHON="python3" fallback lines with the cross-platform chain above. The hooks are idempotent so you can re-run graphify hook install anytime (it won't re-overwrite your edits because the patch only touches the fallback branch).
Activity
fix bugs #256, #253, #244, #226, #254 and bump to 0.4.3
safishamsi commentedon Apr 12, 2026
Fixed in v0.4.3. The interpreter detection now falls back to
python(no suffix) afterpython3— handles Windows installs that don't ship apython3shim. If neither has graphify installed the hook exits 0 silently instead of erroring.fix bugs Graphify-Labs#256, Graphify-Labs#253, Graphify-Labs#244, Gra…
fix bugs #256, #253, #244, #226, #254 and bump to 0.4.3
fix bugs Graphify-Labs#256, Graphify-Labs#253, Graphify-Labs#244, Gra…