Skip to content

Feature request: Add flag to skip hooks in git gtr new #90

@lucasrcezimbra

Description

@lucasrcezimbra

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:

  1. Quick worktree creation - When you need a worktree fast and don't need the post-setup.
  2. Debugging - Testing worktree creation without hook side effects
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions