Skip to content

Instantly share code, notes, and snippets.

@nvanderw
Created June 15, 2012 23:52
Show Gist options
  • Save nvanderw/2939259 to your computer and use it in GitHub Desktop.
Save nvanderw/2939259 to your computer and use it in GitHub Desktop.
A pre-receive hook for blacklisting certain objects
#!/usr/bin/env bash
# Blacklist commit 1abfdd7
root=$(awk '{print $2}')
objects=$(git rev-list --objects $root | awk '{print $1}')
echo $objects | grep 1abfdd7cb8c67ead50757ea596aa0f01b0ab1389 > /dev/null
if [[ $? -eq 0 ]]
then
exit 1
else
exit 0
fi
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment