[ANNOUNCE] A pre-receive hook to intelligently block binary data

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 23:02:49

After searching around a bit I couldn't find a stand-alone Git hook
that would intelligently block binary data pushes so I wrote my own:
https://github.com/avar/pre-receive-reject-binaries

Main features:

 * Quota per-commit for how much binary data is OK
 * Ability to optionally allow users to override binary pushes by
including a notice in their commit messages
 * Doesn't disallow removing existing binary data, or renaming
existing binary files
 * Will block commits that include references to existing binary blobs though
 * Spots cases where a push is pushing commits that add and then
remove binary blobs (i.e. counts net additions)
 * Has hookable support for logging by piping its output to external
commands when it runs or when it rejects/unblocks a binary push. I'm
using this for logging its output to a logfile, and to send E-Mails
when it blocks/is unblocked.
* Only requires a stock perl install, should run on any *nix-like OS
out of the box
* Should be relatively fast compared to some other similar solutions
I've seen, i.e. it parses the output of one "git-log --stat" command
for the entire push, and doesn't e.g. do a "git show" for each commit
being pushed.

One general note about git-log output: I was disappointed to see that
there was no easily parsable "git log" output that showed you how much
binary files increased in size, --numstat will just show "-" for
binary files, and it's non-trivial to parse the "--stat" output. It's
meant for human consumption and will sometimes include variations in
how much whitespace is inserted.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help