is there an easy way to pass `--no-verify` by def...
# how-do-i
g
is there an easy way to pass
--no-verify
by default into the
gt
subcommands? I’m having troubles using
gt create
with our pre-commit hook
j
you can create an alias, something like
gt cn
for
create --no-verify
perhaps? see
gt aliases
šŸ‘ 1
Curious what these troubles were, as we're now thinking about how we will build better Git Hook support (or potentially Graphite hooks)
g
1. our team uses a really simple pre-commit hook that validates whether the git branch matches a certain regex. for some reason this just fails in graphite, even when I’m already on an established stack with a valid branch name. 2. we also have a pre-push hook that runs prettier/linters and can take somewhere around 3-10 seconds. When I was first trying out graphite and not feeling like I understood what git trickery it was doing, this waiting and lack of output during the
Pushing to remote and creating/updating PRs...
made me quite uneasy example output of 1
Copy code
# in web on gl-01-22-my-valid-branch-name
$ gt create
āœ” You have no staged changes. What would you like to do? › Commit all file changes (--all)
╭──────────────────────────────────────╮
│ 🄊 lefthook v1.5.2  hook: pre-commit │
╰──────────────────────────────────────╯
ā”ƒ  git-policy āÆ

Branch names in this project must adhere to this contract: ^[a-z0-9.-]+$. Your commit will be rejected. You should rename your branch to a valid name and try again.
j
Do you know if your
pre-push
hook checks out the branch being pushed to run prettier/linters? In
gt submit
we may push not only the current branch, but also other branches in your stack. More context on why i am asking this: https://graphite-community.slack.com/archives/C02DRNRA9RA/p1706057185500869?thread_ts=1701981481.815529&cid=C02DRNRA9RA
g
it seems the
pre-push
hook we have only runs linters on the current head, its not checking out other branches
I’m thinking my case 1 was me not understanding what
gt create
does. I already do
gt create -m 'commit msg that will generate a safe branch name'
to avoid the branch regex hook from yelling at me. and sometimes I conflate
gt create
with
git commit
its hard when so much of my git usage is basically muscle memory and now
gt
is forcing me to actually think before I type things in šŸ˜“