Skip to content

Upgrading doesn't refresh already-installed git hooks: #2253 console-window fix never reaches existing repos (or init.templateDir) #3771

Closed

Description

Problem

The #2253 fix (v0.9.29, CREATE_NO_WINDOW in the hook launcher) only helps hooks installed after the upgrade. The launcher is embedded as text in each repo's .git/hooks/post-commit / post-checkout, so upgrading the package leaves every existing hook on the old DETACHED_PROCESS launcher, and those keep opening a visible console window on every commit and checkout.

Real-world scale: after upgrading 0.9.25 -> 0.9.65 on one Windows machine, ~660 hook files still carried the old flags, including:

  • repos under C:\dev / D:\
  • a git init.templateDir (~/.git-template/hooks). Every new clone/init copies the stale launcher, including tool-managed clones such as Codex plugin marketplace caches under ~/.codex/...

Result: after the upgrade, windows kept appearing (captured via EnumWindows: ConsoleWindowClass titled ...\uv\tools\graphifyy\Scripts\python.exe, running the changed_raw rebuild body).

Suggested fixes

  1. On startup (or in graphify hook status / any CLI run), detect the installed hook block's launcher version and rewrite it when stale. The # graphify-hook-start/end markers already make an in-place refresh safe.
  2. Add a graphify hook refresh --all (or make hook install idempotently rewrite an outdated block).
  3. Mention in the v0.9.29+ release notes that existing hooks must be reinstalled.

Workaround

Replace 0x00000008 | 0x00000200 with 0x08000000 | 0x00000200 in existing hook files (including the git template dir), or add a .pth in the tool venv that rewrites DETACHED_PROCESS to CREATE_NO_WINDOW in subprocess.Popen.

Env: Windows 10 22H2 (19045), uv tool install, Git for Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions