Commit 1f2e43e
Ismar Iljazovic
feat: hook ownership model with external manager detection
Implement two-mode hook ownership: GitButler-managed (installs hooks
directly) vs externally-managed (defers to prek/lefthook/husky).
- Add hook_manager.rs: detect external managers via config + binary gate
- Refactor managed_hooks.rs: ensure_managed_hooks() shared entry point
- Add pre-push guard hook (blocks pushing gitbutler/workspace)
- Add --no-hooks / --force-hooks escape hatches to setup/teardown
- Hook lifecycle: staleness detection, auto-update, config persistence
- Desktop app (integration.rs) uses same ensure_managed_hooks() path
Addresses #12748
refactor: extract but-hooks crate from gitbutler-repo
feat: add but hook CLI subcommands for hook manager integration
Expose GitButler workspace guard and cleanup as standalone CLI commands
that external hook managers can invoke from their configuration:
- but hook pre-commit: blocks git commit on gitbutler/workspace
- but hook post-checkout: info message when leaving workspace branch
- but hook pre-push: blocks git push on gitbutler/workspace
- but hook status: diagnostic view of hook ownership and integration state
Follows up on hook-ownership-core.1 parent f4921c5 commit 1f2e43e
File tree
49 files changed
+5991
-1087
lines changed- crates
- but-api
- but-core/src
- but-hooks
- src
- hook_manager
- managed_hooks
- tests/hooks
- common
- hook_manager
- managed_hooks
- but-workspace/src/commit
- but
- skill/references
- src
- args
- command
- legacy
- utils
- tests/but/command
- gitbutler-branch-actions
- src
- tests/branch-actions/virtual_branches
- gitbutler-repo
- src
- tests
- packages/but-sdk/src/generated
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
49 files changed
+5991
-1087
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
| 161 | + | |
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
| |||
212 | 214 | | |
213 | 215 | | |
214 | 216 | | |
| 217 | + | |
215 | 218 | | |
216 | 219 | | |
217 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
118 | 121 | | |
119 | 122 | | |
120 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
469 | | - | |
470 | | - | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
471 | 473 | | |
472 | 474 | | |
473 | 475 | | |
474 | | - | |
| 476 | + | |
475 | 477 | | |
476 | 478 | | |
477 | 479 | | |
| |||
481 | 483 | | |
482 | 484 | | |
483 | 485 | | |
484 | | - | |
| 486 | + | |
485 | 487 | | |
486 | 488 | | |
487 | 489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments