[PR #564] [CLOSED] Add core hooks support and worktree coverage #576

Closed
opened 2026-03-02 04:14:01 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/git-ai-project/git-ai/pull/564
Author: @jwiegley
Created: 2/19/2026
Status: Closed

Base: mainHead: codex/worktree-support-corehooks


📝 Commits (10+)

  • 0ae0625 feat: support git-ai global hooks alongside wrapper mode
  • 0d565d2 ci: run test matrix across os and git test modes
  • fadec1b Fix hook env leak and ensure git_og bypasses hooks
  • a36dacc Harden hook mode rewrite handling for squash/cherry/pull/reset/stash
  • 56a0fb2 Format hook handler updates
  • f1d7ab1 Fix Windows hooks-mode test harness binary path
  • 644bf24 Optimize hook invocation startup for no-op hooks
  • 9f88dac Fix clippy warning in hook forwarding fast path
  • cc69f7b Fix repo hook self-heal repository resolution
  • 5951fff Optimize hooks-mode performance for rebase-heavy workflows

📊 Changes

75 files changed (+9580 additions, -224 deletions)

View changed files

.github/workflows/performance-benchmarks.yml (+129 -0)
📝 .github/workflows/test.yml (+3 -1)
📝 .gitignore (+3 -1)
scripts/benchmarks/git/benchmark_modes_vs_main.py (+1174 -0)
scripts/benchmarks/git/benchmark_nasty_modes_vs_main.py (+725 -0)
📝 scripts/benchmarks/git/benchmark_nasty_rebases.sh (+65 -0)
📝 src/authorship/rebase_authorship.rs (+93 -0)
📝 src/commands/blame.rs (+56 -20)
📝 src/commands/checkpoint.rs (+2 -0)
📝 src/commands/flush_cas.rs (+4 -9)
📝 src/commands/flush_metrics_db.rs (+7 -9)
📝 src/commands/git_ai_handlers.rs (+44 -0)
📝 src/commands/git_handlers.rs (+122 -6)
src/commands/git_hook_handlers.rs (+3137 -0)
📝 src/commands/hooks/push_hooks.rs (+148 -32)
📝 src/commands/mod.rs (+1 -0)
📝 src/commands/upgrade.rs (+7 -11)
📝 src/config.rs (+13 -2)
📝 src/error.rs (+1 -0)
📝 src/git/repository.rs (+151 -52)

...and 55 more files

📄 Description

Summary

  • Add core hooks mode support with core.hooksPath based hook dispatch
  • Comprehensive worktree support and coverage across all git modes
  • Fix Windows compatibility issues in hook scripts and test infrastructure
  • Buffer stdin for hook chaining (post-rewrite, reference-transaction, pre-push)
  • Fix wrapper-only mode silently suppressing user hooks

Test plan

  • All Ubuntu tests pass (hooks, wrapper, both modes)
  • All macOS tests pass (hooks, wrapper, both modes)
  • Windows worktree path normalization and CRLF handling
  • Core hooks install/uninstall e2e tests
  • Hook chaining and self-reference detection

🤖 Generated with Claude Code


Open with Devin

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/git-ai-project/git-ai/pull/564 **Author:** [@jwiegley](https://github.com/jwiegley) **Created:** 2/19/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/worktree-support-corehooks` --- ### 📝 Commits (10+) - [`0ae0625`](https://github.com/git-ai-project/git-ai/commit/0ae062585e74fead1102d4f147335b0747d078a9) feat: support git-ai global hooks alongside wrapper mode - [`0d565d2`](https://github.com/git-ai-project/git-ai/commit/0d565d2290229cb53fac477d30e1bff872900e1c) ci: run test matrix across os and git test modes - [`fadec1b`](https://github.com/git-ai-project/git-ai/commit/fadec1bfde14d7ff5f4aee5294f333a8666462d4) Fix hook env leak and ensure git_og bypasses hooks - [`a36dacc`](https://github.com/git-ai-project/git-ai/commit/a36dacc2e2a8f763f49fe89847459e849c5996ee) Harden hook mode rewrite handling for squash/cherry/pull/reset/stash - [`56a0fb2`](https://github.com/git-ai-project/git-ai/commit/56a0fb2593f74f1fdea8663c94e6fecd0e9b0519) Format hook handler updates - [`f1d7ab1`](https://github.com/git-ai-project/git-ai/commit/f1d7ab1ea544d9a8a93bf0b63a471ab5a1bce17b) Fix Windows hooks-mode test harness binary path - [`644bf24`](https://github.com/git-ai-project/git-ai/commit/644bf24b9f5898677629d486b6225c62125858f4) Optimize hook invocation startup for no-op hooks - [`9f88dac`](https://github.com/git-ai-project/git-ai/commit/9f88dac6b62057be2a3cfbd6aa5f1fdcf9824b64) Fix clippy warning in hook forwarding fast path - [`cc69f7b`](https://github.com/git-ai-project/git-ai/commit/cc69f7b802fb584c9895ce6f2832028c08a4e551) Fix repo hook self-heal repository resolution - [`5951fff`](https://github.com/git-ai-project/git-ai/commit/5951fff22554f7814c6140eb48f7028d28a6fce1) Optimize hooks-mode performance for rebase-heavy workflows ### 📊 Changes **75 files changed** (+9580 additions, -224 deletions) <details> <summary>View changed files</summary> ➕ `.github/workflows/performance-benchmarks.yml` (+129 -0) 📝 `.github/workflows/test.yml` (+3 -1) 📝 `.gitignore` (+3 -1) ➕ `scripts/benchmarks/git/benchmark_modes_vs_main.py` (+1174 -0) ➕ `scripts/benchmarks/git/benchmark_nasty_modes_vs_main.py` (+725 -0) 📝 `scripts/benchmarks/git/benchmark_nasty_rebases.sh` (+65 -0) 📝 `src/authorship/rebase_authorship.rs` (+93 -0) 📝 `src/commands/blame.rs` (+56 -20) 📝 `src/commands/checkpoint.rs` (+2 -0) 📝 `src/commands/flush_cas.rs` (+4 -9) 📝 `src/commands/flush_metrics_db.rs` (+7 -9) 📝 `src/commands/git_ai_handlers.rs` (+44 -0) 📝 `src/commands/git_handlers.rs` (+122 -6) ➕ `src/commands/git_hook_handlers.rs` (+3137 -0) 📝 `src/commands/hooks/push_hooks.rs` (+148 -32) 📝 `src/commands/mod.rs` (+1 -0) 📝 `src/commands/upgrade.rs` (+7 -11) 📝 `src/config.rs` (+13 -2) 📝 `src/error.rs` (+1 -0) 📝 `src/git/repository.rs` (+151 -52) _...and 55 more files_ </details> ### 📄 Description ## Summary - Add core hooks mode support with `core.hooksPath` based hook dispatch - Comprehensive worktree support and coverage across all git modes - Fix Windows compatibility issues in hook scripts and test infrastructure - Buffer stdin for hook chaining (post-rewrite, reference-transaction, pre-push) - Fix wrapper-only mode silently suppressing user hooks ## Test plan - [x] All Ubuntu tests pass (hooks, wrapper, both modes) - [x] All macOS tests pass (hooks, wrapper, both modes) - [x] Windows worktree path normalization and CRLF handling - [x] Core hooks install/uninstall e2e tests - [x] Hook chaining and self-reference detection 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/git-ai-project/git-ai/pull/564" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 04:14:01 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-ai#576
No description provided.