Open shpaass opened 4 days ago
https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks I'll make a client-side check.
Hmm, git doesn't track .git
directory, so storing things in .git/hooks
is not an option.
It seems like we'll need something like a configure.sh
script to run git config core.hooksPath .githooks
. Git does not set environment variables due to security.
Git does not set environment variables due to security.
Indeed, otherwise it would be very easy for you to steal my data, by just having a git hook that zips my disk and send it over to you :wink: Therefore, there is always a manual step needed to activate (local) hooks. (Usually by copying some scrip to the 'installed hooks location').
If you want to force certain tests/checks, they only guaranteed way is to do it server side (in our case with GitHub Actions).
As someone mentioned recently, it would be good if the
dotnet format
part of the check was done before the commit is accepted into the PR. That is usually done by git hooks, either on the client or server side. We need to investigate how to set it up.