Summary
Add a flag to the git gtr new command to skip executing hooks, similar to how --no-copy skips file copying and --no-fetch skips git fetch.
Use Case
The new command already supports flags to skip optional operations:
--no-copy - Skip file copying
--no-fetch - Skip git fetch
However, there's no way to skip hooks when creating a worktree. This would be useful for:
- Quick worktree creation - When you need a worktree fast and don't need the post-setup.
- Debugging - Testing worktree creation without hook side effects
- Consistency with git - Git itself uses
--no-verify to skip hooks on commit/push/merge
Proposed Solution
Add a flag that skips hook execution in cmd_create().
# Current: hooks always run
git gtr new my-feature
# Proposed: skip hooks
git gtr new my-feature --<flag>
Naming Options
| Flag |
Pros |
Cons |
--no-hooks |
Consistent with --no-copy/--no-fetch pattern; concise |
Inconsistent with git's --no-verify convention |
--no-verify |
Matches git's convention (git commit --no-verify) |
gtr hooks aren't verification hooks; could be misleading |
--no-post-create |
Explicit about which hook is skipped |
Verbose; only applies to current hook; would need separate flags for future hooks |
Compatibility
- Backwards compatible - Adds a new optional flag; existing behavior unchanged
- Cross-platform - No platform-specific concerns; pure Bash flag parsing
Summary
Add a flag to the
git gtr newcommand to skip executing hooks, similar to how--no-copyskips file copying and--no-fetchskips git fetch.Use Case
The
newcommand already supports flags to skip optional operations:--no-copy- Skip file copying--no-fetch- Skip git fetchHowever, there's no way to skip hooks when creating a worktree. This would be useful for:
--no-verifyto skip hooks on commit/push/mergeProposed Solution
Add a flag that skips hook execution in
cmd_create().Naming Options
--no-hooks--no-copy/--no-fetchpattern; concise--no-verifyconvention--no-verifygit commit --no-verify)--no-post-createCompatibility