The documentation[1] says that the ‘--numstat’ option for ‘git diff’ will
display ‘-’ for both added and deleted lines for binary files. This script uses
that to detect that binary files are being pushed and will reject them.
This is naive and simplistic. ‘git diff’ shows the same output when binary files
are deleted (or replaced with git-lfs placeholders), so this would prevent us
from fixing errors. But for now it helps us prevent accidental submissions of
binary files.
[1]: man 1 git-diff
This script does what was previously done by the git hook script. It takes the
commit before the push and the one after the push and lists the directories that
have been affected in those commits.
This script doesn't yet start an actual process for processing the directories,
it just prints what it thinks a command line might look like.
The git hook script should only extract the necessary information the build
script needs to operate. Right now this is only the commit before the push and
after the push, and the refname is added for future use.
The name of the variables passed to the laminar build are modeled after those
found in the GitLab CI documentation, just for some familiarity.
The functionality of finding the relevant directories has been moved to the
build script.