3 ms·
echo 'The push will now exit with an error. No commits have actually been pushed.' Is this part so that the temporary git objects are cleaned up? Or is there s
by codetrotter 2y ago
echo 'The push will now exit with an error. No commits have actually been pushed.'
Is this part so that the temporary git objects are cleaned up? Or is there some other reason that it has to exit with error?
- Sesse__ 2y agoIt is so that the push doesn't actually become a push. :-) If the pre-receive hook exits with success, the push goes through and random people can write whatever they want to my repository. If it fails, the repository is left exactly as it was (including, as you point out, the quarantined temporary objects going away). One could in theory use git namespaces to keep the new branches but not make them overwrite existing ones, but then people could store porn or whatever for free on your server and have it be served to others. (I wrote the blog post)
- codetrotter 2y agoNeat! Thanks for explaining :) > keep the new branches but not make them overwrite existing ones, but then people could store porn or whatever for free on your server and have it be served to others When your program sends the mail, do you use any external services for that (GMail, etc) or do you run a local SMTP server? How about the receiving address, is that one self-hosted or powered by a third-party?
- Sesse__ 2y agoI deliver and read mail locally. I don't think that matters a whole lot in this case, though? As long as you can send email from your server to yourself somehow, I guess you're fine.
- codetrotter 2y agoMainly thinking because if you use a third-party you could potentially trigger some spam metric if someone were to submit PRs full of spam, and thereby getting your domain landed on some blacklist which in turn would make more of the real mail you yourself send at risk of getting trapped in spam. So using a local-only / fully self-hosted mail delivery solution is definitely the best way to do it IMO.