Hey team! I've just installed Graphite CLI on a ne...
# report-bugs
e
Hey team! I've just installed Graphite CLI on a new laptop via Homebrew, I'm on version 1.7.0, and it looks like
gt submit
passes the
--no-verify
arg to git, which skips our git LFS hooks:
Copy code
$ gt submit --stack

git push -u origin --force-with-lease --progress [branch names] --no-verify --atomic
According to the docs,
--verify
should be the default option, so not sure if it's a bug or I've got a weird global config somewhere. Can you please help me troubleshoot this? Thank you!
p
(If applicable) To help us repro, please send the following if you haven't already: - PR links, screenshots, and/or debug output if applicable - Repro steps - Does this happen consistently? Just to you or others on your team also? - Is this a regression? Is the problem new? - If you're having an issue with the CLI, please send us debug logs using
gt feedback --with-debug-context <any message>
e
Submitted logs using
gt feedback --with-debug-context <any message>
!
p
Good Morning Egor, thanks for the detailed report. I am seeing the same. Let me run it by the team to understand if the docs are incorrect or this is a bug.
e
Thank you!
FWIW a colleague of mine reported a similar issue in 1.6.7 and mentioned that it was fixed in 1.6.8, so maybe it regressed?
p
Egor, is this a pre-push hook that didnt execute?
I did a bit more digging here. Turns out, for pre-push hooks, we actually execute prior to the git push command. You can see this in my screenshot of
gt submit --debug
below. So the push command itself having the
--no-verify
should not impact the hook triggering. I also tested this with
--no-verify
explicitely in my
gt submit
command and saw it did not in fact run.
Did a hook not run that you had expected to, or were you just thrown off by the debug log showing
--no-verify
?
e
Did a hook not run that you had expected to, or were you just thrown off by the debug log showing
--no-verify
?
Yeah, we've got some git LFS hooks in our project, and the hook that's supposed to upload files to LFS didn't run, so the push complained about unknown git LFS references. I believe that was the pre-push hook, but I'll debug some more to make sure, will get back to you!
Hmm, interesting, I'm seeing a different behavior from yours: I added an
echo
statement to the pre-push hook, and when I run
gt submit
I don't see the printout.
gt submit
then runs
git push
, which fails because of
--no-verify
(we also have a server-side pre-receive hook that verifies that git LFS objects were properly uploaded, and the hook rejects the push because pre-push didn't run on the client side and didn't upload the objects). If I simply execute the
git push
command that Graphite tried to run, but without
--no-verify
, I do see the printout from the pre-push hook, and the push doesn't get rejected. So for some reason the pre-push hook does not get executed for me. Are you on 1.7.0?
p
Yes i am also on 1.7.0 Can we try using my simple prepush hook in
.git/hooks/pre-push
Copy code
#!/bin/sh
echo "=== PRE-PUSH HOOK CALLED ==="
echo "Hook received arguments: $@"
echo "Current branch: $(git branch --show-current)"
echo "this time with the flag"
echo "==========================="

# Exit 0 to allow the push, or exit 1 to block it
exit 0
This should help us validate if the prepush is working in general or not~
e
Yep! Will try that next time I'm pushing something.
Hmm, I added your script as
.git/hooks/pre-push
, and it indeed seems to execute before submit's git push. This makes me think there's an issue with how hooks for our project are configured on my machine, I'll dig into it, but doesn't look like there's anything wrong on Graphite's side. Thanks for helping me investigate!
👍 1
Oh, it looks like git LFS doesn't actually rely on hooks, but on git filters: https://github.com/git-lfs/git-lfs/blob/main/docs/spec.md#intercepting-git. Any idea if there's anything in Graphite that might interfere with this mechanism during
gt submit
?
p
interesting. Ill need to do a bit more digging here. OOC, how often do you need this? Is it every push you make or an occasional thing?