Summary
The git hooks installed by graphify hook install background the graph rebuild with nohup ... &. Git for Windows' bundled shell (MSYS/MINGW64) does not ship nohup (nor
setsid), so the line dies with nohup: command not found and the rebuild never runs. Worse, it fails silently: git commit / git pull return success, no error surfaces to
the user, and the knowledge graph just quietly goes stale.
Environment
- OS: Windows 11
- Shell running the hooks:
C:\Program Files\Git\usr\bin\sh.exe (Git for Windows, MSYSTEM=MINGW64)
git version 2.42.0.windows.2
- graphify installed under conda Python;
graphify hook install reported success and wrote post-commit + post-checkout.
Steps to reproduce
- On Git for Windows, run
graphify hook install in a repo with an existing graphify-out/.
git commit (or pull a branch that fires post-checkout).
- Observe the rebuild log at
~/.cache/graphify-rebuild.log.
Expected
The graph rebuilds in the background and graph.json / GRAPH_REPORT.md update.
Actual
The log contains:
.git/hooks/post-commit: line 101: nohup: command not found
No rebuild happens. The commit/pull exits 0, so the user gets no signal that the graph is now stale. The same flaw is in the post-checkout hook.
Root cause
The hook templates use:
nohup "$GRAPHIFY_PYTHON" -c "...rebuild..." >> "$_GRAPHIFY_LOG" 2>&1 < /dev/null &
disown 2>/dev/null || true
nohup is a coreutils/util-linux tool that is absent from the minimal MSYS2 runtime Git for Windows bundles. setsid is also absent, so it isn't a drop-in substitute. There's no
package manager (pacman) in a stock Git for Windows install to add it either.
Suggested fix
graphify already requires Python, so let Python do the detaching instead of nohup/setsid — this is cross-platform and dependency-free. A tiny launcher spawns the real rebuild as
a fully detached process and returns immediately:
import os, sys, subprocess
cmd = [sys.executable, "-c", REBUILD_SRC]
kwargs = dict(stdout=open(LOG, "a", buffering=1),
stderr=subprocess.STDOUT,
stdin=subprocess.DEVNULL,
cwd=os.getcwd(), close_fds=True)
if os.name == "nt":
DETACHED_PROCESS = 0x00000008
CREATE_NEW_PROCESS_GROUP = 0x00000200
CREATE_BREAKAWAY_FROM_JOB = 0x01000000
base = DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP
try:
subprocess.Popen(cmd, creationflags=base | CREATE_BREAKAWAY_FROM_JOB, **kwargs)
except OSError:
subprocess.Popen(cmd, creationflags=base, **kwargs)
else:
subprocess.Popen(cmd, start_new_session=True, **kwargs) # POSIX setsid equivalent
The hook then just runs "$GRAPHIFY_PYTHON" -c "$LAUNCHER" — no nohup, no &, returns instantly, and the detached child survives the hook (and its shell) exiting.
Summary
The git hooks installed by
graphify hook installbackground the graph rebuild withnohup ... &. Git for Windows' bundled shell (MSYS/MINGW64) does not shipnohup(norsetsid), so the line dies withnohup: command not foundand the rebuild never runs. Worse, it fails silently:git commit/git pullreturn success, no error surfaces tothe user, and the knowledge graph just quietly goes stale.
Environment
C:\Program Files\Git\usr\bin\sh.exe(Git for Windows,MSYSTEM=MINGW64)git version 2.42.0.windows.2graphify hook installreported success and wrotepost-commit+post-checkout.Steps to reproduce
graphify hook installin a repo with an existinggraphify-out/.git commit(or pull a branch that firespost-checkout).~/.cache/graphify-rebuild.log.Expected
The graph rebuilds in the background and
graph.json/GRAPH_REPORT.mdupdate.Actual
The log contains:
No rebuild happens. The commit/pull exits 0, so the user gets no signal that the graph is now stale. The same flaw is in the
post-checkouthook.Root cause
The hook templates use:
nohupis a coreutils/util-linux tool that is absent from the minimal MSYS2 runtime Git for Windows bundles.setsidis also absent, so it isn't a drop-in substitute. There's nopackage manager (
pacman) in a stock Git for Windows install to add it either.Suggested fix
graphify already requires Python, so let Python do the detaching instead of
nohup/setsid— this is cross-platform and dependency-free. A tiny launcher spawns the real rebuild asa fully detached process and returns immediately:
The hook then just runs
"$GRAPHIFY_PYTHON" -c "$LAUNCHER"— nonohup, no&, returns instantly, and the detached child survives the hook (and its shell) exiting.