Support git hook installation from worktree checkouts#465
Open
candy-Tong wants to merge 98 commits into
Open
Conversation
* fix: git hooks fail when graphify is installed via pipx When installed via pipx, the graphify module is only available in pipx's isolated venv, not the system python3. The git hooks (post-commit, post-checkout) hardcoded `python3` which cannot import graphify in this case. Detect the correct Python interpreter from the graphify binary's shebang line, matching the approach already used in skill.md Step 1. Falls back to python3 for system installs. * fix: handle env-style shebangs and improve interpreter detection - Use POSIX `command -v` instead of non-standard `which` - Parse `#!/usr/bin/env python3` shebangs correctly (previous `tr -d ' '` would produce `/usr/bin/envpython3`) - Add import validation fallback to python3 if resolved interpreter cannot import graphify
… buffer * fix: suppress graspologic ANSI output that breaks PowerShell scrolling graspologic's leiden() emits ANSI escape sequences (progress bars, colored warnings) that corrupt PowerShell 5.1's scroll buffer on Windows, disabling vertical scrolling. Redirect stdout/stderr to StringIO during leiden() calls to prevent any escape codes from reaching the terminal. Add 2 tests verifying cluster() produces no stdout/stderr output. Fixes Graphify-Labs#19 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: add PowerShell troubleshooting section to Windows skill Document the PowerShell 5.1 scrolling issue and provide 4 workarounds: upgrade graphify, use Windows Terminal, reset terminal, or uninstall graspologic to use Louvain fallback. Fixes Graphify-Labs#19 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
- Register 'trae' and 'trae-cn' in _PLATFORM_CONFIG (skill-trae.md, ~/.trae/skills/ and ~/.trae-cn/skills/, claude_md=False) - Add CLI subcommands: graphify trae install/uninstall, graphify trae-cn install/uninstall (routes to _agents_install/uninstall) - Update help text with new platform entries - Create skill-trae.md (Agent-tool based extraction, AGENTS.md integration, no PreToolUse hook support per Trae limitations) - Update README.md and README.zh-CN.md with Trae platform docs Co-authored-by: lijinshuan <lijinshuan@bytedance.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…utput Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ean README, save-result CLI
…y-Labs#109: extension drift, click detection, skill coverage, .graphify_python persistence Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-Labs#93 Graphify-Labs#102 Graphify-Labs#109) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ify-Labs#126) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Graphify-Labs#71) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e relations in innerHTML (#sec) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…y-Labs#127) Tree-sitter resolves call targets directly from source — marking them INFERRED was incorrect. Cross-file class-level uses edges remain INFERRED. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…AST calls Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Windows git hooks (Graphify-Labs#140) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…sh (Graphify-Labs#137, Graphify-Labs#148, Graphify-Labs#149) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…hify-Labs#105) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…NTS.md python3 fix Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e plugin, cache root, PHP missing edges, Windows stability, cross-file calls - Graphify-Labs#352: add skill-kiro.md to pyproject.toml package-data - Graphify-Labs#341: guard edge_betweenness at >5000 nodes; use approximate k=100 for suggest_questions on large graphs - Graphify-Labs#354/Graphify-Labs#229: add Step 6b in skill.md to call to_wiki() when --wiki given (before Step 9 cleanup) - Graphify-Labs#356: call _install_opencode_plugin() from install --platform opencode path - Graphify-Labs#350: add cache_root param to extract() so subdirectory runs keep cache at ./graphify-out/cache/ - Graphify-Labs#230: PHP class_constant_access_expression emits references_constant edges - Graphify-Labs#232: PHP scoped_call_expression (static method calls) emits calls edges - Graphify-Labs#287: os.replace fallback for Windows WinError 5; graphify update exits 1 on failure; templates use graphify update . instead of python3 -c - Graphify-Labs#348: cross-file call resolution for all languages via raw_calls + global label map pass in extract() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…js, macOS watch, god_nodes degree rename Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…correct rustworkx APIs, git fetch strategy
…aphify-Labs#401 Graphify-Labs#385, team workflow docs, Windows/pipx tips Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Graphify-Labs#418 graph.html missing from CLI
…raphify-Labs#423 --update drops existing nodes
…add .mdx to DOC_EXTENSIONS
…#260 add .html to DOC_EXTENSIONS
…s#431 Go import node ID collision
Git worktrees store their active hooks in the common git directory, so reading only core.hooksPath missed the default hook location for worktree checkouts. Resolve the hooks path through git itself and add regression coverage for install/uninstall from a worktree. Constraint: Must preserve existing core.hooksPath behavior (for example Husky) Rejected: Parse .git worktree indirection manually | git already exposes the resolved hooks path Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep hook-path resolution delegated to git so worktree and hooksPath semantics stay aligned Tested: uv run --with pytest pytest -q Tested: uv run --with pytest pytest -q tests/test_hooks.py Not-tested: Remote GitHub CI on this branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Git worktrees store their active hooks in the common git directory, so reading only core.hooksPath missed the default hook location for worktree checkouts. Resolve the hooks path through git itself and add regression coverage for install/uninstall from a worktree.
Constraint: Must preserve existing core.hooksPath behavior (for example Husky)
Rejected: Parse .git worktree indirection manually | git already exposes the resolved hooks path
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep hook-path resolution delegated to git so worktree and hooksPath semantics stay aligned
Tested: uv run --with pytest pytest -q
Tested: uv run --with pytest pytest -q tests/test_hooks.py
Not-tested: Remote GitHub CI on this branch