Fix your shit and it won’t stop you from committing.
It’s also usually only on certain branches, so you can make a branch where you break things and then fix them before you merge to testing/main/whatever.
That seems reasonable to perform on protected branches, but I’m not a fan of protecting all branches. That could leave valuable code with a single copy on a dev machine. I’d rather have it pushed to an unprotected branch and then be checked on merge instead of push.
Fix your shit and it won’t stop you from committing.
It’s also usually only on certain branches, so you can make a branch where you break things and then fix them before you merge to testing/main/whatever.
TIL precommit hooks can be set per branch. I was being facetious to begin with but this sounds pretty good actually.
Nah, at our place it’s applied on all branches…
What do you do if you have code that isn’t complete enough to work? Do you have to just leave it untracked?
I don’t know what others do, but I personally whip out git commit -n and bypass the hooks in this situation.
deleted by creator
Every branch you have deploys on commit? You have to fully QA all of your code before it goes into any sort of source control?
deleted by creator
That seems reasonable to perform on protected branches, but I’m not a fan of protecting all branches. That could leave valuable code with a single copy on a dev machine. I’d rather have it pushed to an unprotected branch and then be checked on merge instead of push.
deleted by creator
So, what if I want to push some debug or preliminary code to a topic branch, would this system prevent this if all tests don’t pass?
deleted by creator
That is reasonable