Discover in Git hook if git was called by Arcanist?


#1

Hello! I have some git hooks that prevent commits directly to a release branch. I want these to exist, but they should be disabled when calling arc land. Is there a way to discover inside the hook that git was called by Arcanist? Or can Arcanist toggle hooks while running?

Thanks!


#2

Are these hooks on the server or on the client?
If it’s in the server, re-implement them using Herald or move them according to https://secure.phabricator.com/book/phabricator/article/diffusion_hooks/.
If it’s in the client, then it won’t actually stop what you’re trying to prevent, and you should move them to the server anyway.

I don’t know of an easy way to figure out if a git command is executed from inside arc.