![](https://upvote.au/pictrs/image/84065ed2-43b1-4ab2-8678-dfcd7e760a7b.jpeg)
![](https://programming.dev/pictrs/image/170721ad-9010-470f-a4a4-ead95f51f13b.png)
Would a git hook block you from committing it locally, or would it just run on the server side?
I’m not sure how our one at work is implemented, but we can actually commit @nocommit
files in our local repo, and push them into the code review system. We just can’t merge any changes that contain it.
It’s used for common workflows like creating new database entities. During development, the ORM system creates a dev database on a test DB cluster and automatically points the code for the new table to it, with a @nocommit
comment above it. When the code is approved, the new schema is pushed to prod and the code is updated to point to the real DB.
Also, the codebase is way too large for something like ripgrep to search the whole codebase in a reasonable time, which is why it only searches the commit diffs themselves.
I’m not sure, sorry. The source control team at work set it up a long time ago. I don’t know how it works - I’m just a user of it.
The linter probably just runs
git diff | grep @nocommit
or similar.