You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows: post-commit and post-checkout hooks fail with 'python3: command not found' #244
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:
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 python is on PATH but python3 is not)
pip install graphifyy
cd some-repo && graphify hook install
Make any commit
Observe: python3: command not found on 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 silentlyif [ -z"$GRAPHIFY_PYTHON" ];thenifcommand -v python3 >/dev/null 2>&1&& python3 -c "import graphify"2>/dev/null;then
GRAPHIFY_PYTHON="python3"elifcommand -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 machineexit 0
fifi
I'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 (no python3 symlink)
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).
Fixed in v0.4.3. The interpreter detection now falls back to python (no suffix) after python3 — handles Windows installs that don't ship a python3 shim. If neither has graphify installed the hook exits 0 silently instead of erroring.
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…