Skip to content

Use repository-owned native Git hooks - #300

Merged
patroza merged 3 commits into
fork/changesfrom
refactor/native-githooks
Aug 3, 2026
Merged

Use repository-owned native Git hooks#300
patroza merged 3 commits into
fork/changesfrom
refactor/native-githooks

Conversation

@patroza

@patroza patroza commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Why

Worktrees and branch checkouts must reconcile pnpm dependencies without relying on a machine-specific shared dispatcher or an agent noticing missing node_modules. Fresh repositories cloned by T3 need the same setup before they are handed to the user.

What

Moves commit, push, and checkout hooks into tracked .githooks, configures core.hooksPath=.githooks during pnpm install, and removes Husky. The checkout hook runs synchronously for branch changes and linked-worktree creation. T3 also activates and triggers the native checkout hook immediately after cloning repositories that provide it.

How

The clone service configures the repository-local hook path, then checks out the fresh HEAD once; Git invokes post-checkout and waits for its package reconciliation. Existing clones are activated by their next pnpm install, while machine bootstrap remains responsible for reconciling already-present repositories. Lefthook is documented only as a possible future parallel job runner and is not installed or used.

Remarks

Focused native-hook and source-control tests pass. Design angles: reliable package state at user handoff — pragmatic native hooks now; a future parallel runner can sit behind those hooks without owning installation.

@patroza
patroza marked this pull request as ready for review August 3, 2026 12:45
@patroza
patroza merged commit 607ab64 into fork/changes Aug 3, 2026
10 checks passed
patroza added a commit that referenced this pull request Aug 4, 2026
* refactor: use repository-owned native git hooks

* test: keep clone hook fixture synchronous

* test: map clone fixture filesystem failures

---------

Co-authored-by: Stack Test <stack-test@example.com>
patroza added a commit that referenced this pull request Aug 4, 2026
* refactor: use repository-owned native git hooks

* test: keep clone hook fixture synchronous

* test: map clone fixture filesystem failures

---------

Co-authored-by: Stack Test <stack-test@example.com>
patroza added a commit that referenced this pull request Aug 4, 2026
* refactor: use repository-owned native git hooks

* test: keep clone hook fixture synchronous

* test: map clone fixture filesystem failures

---------

Co-authored-by: Stack Test <stack-test@example.com>
patroza added a commit that referenced this pull request Aug 5, 2026
* refactor: use repository-owned native git hooks

* test: keep clone hook fixture synchronous

* test: map clone fixture filesystem failures

---------

Co-authored-by: Stack Test <stack-test@example.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant