Skip to content

Instantly share code, notes, and snippets.

@bleach
Last active December 22, 2015 11:28
Show Gist options
  • Save bleach/6465482 to your computer and use it in GitHub Desktop.
Save bleach/6465482 to your computer and use it in GitHub Desktop.
This lives on our git server as /usr/local/bin/git and advises people where they went wrong when creating a new repo.
$ git init
________________________________________
/ Friends don't let friends run git init \
\ without --shared /
----------------------------------------
\ . .
\ / `. .' "
\ .---. < > < > .---.
\ | \ \ - ~ ~ - / / |
_____ ..-~ ~-..-~
| | \~~~\.' `./~~~/
--------- \__/ \__/
.' O \ / / \ "
(_____, `._.' | } \/~~~/
`----. / } | / \__/
`-. | / | / `. ,~~|
~-.__| /_ - ~ ^| /- _ `..-'
| / | / ~-. `-. _ _ _
|_____| |_____| ~ - . _ _ _ _ _>
#!/bin/bash
#
# Wrapper to stop people creating repos without the --shared option.
# So that there are fewer ragepunches.
YOUR_ACTUAL_GIT='/usr/bin/git'
if [ "$1" = 'init' ] && ! echo "$@" | egrep -q -- '[[:space:]]--shared([[:space:]]|$)'
then
cowsay -f stegosaurus \
"Friends don't let friends run git init without --shared"
exit 999
else
exec $YOUR_ACTUAL_GIT "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment