Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
41 lines (36 sloc) 2.29 KB
#!/bin/sh
# Written by Adam Haile - Maniacal Labs (adam@maniacallabs.com)
# Inspired by: https://gist.github.com/pixelhandler/5718585
# Install: cp vader-pre-push.sh <GITREPO>/.git/hooks/pre-push
# chmod +x <GITREPO>/.git/hooks/pre-push
# Prints the following whenever a force push is attempted
# _________________________________
# |:::::::::::::;;::::::::::::::::::|
# |:::::::::::'~||~~~``:::::::::::::|
# |::::::::' .': o`:::::::::::|
# |:::::::' oo | |o o ::::::::::|
# |::::::: 8 .'.' 8 o :::::::::|
# |::::::: 8 | | 8 :::::::::|
# |::::::: _._| |_,...8 :::::::::|
# |::::::'~--. .--. `. `::::::::|
# |:::::' =8 ~ \ o ::::::::|
# |::::' 8._ 88. \ o::::::::|
# |:::' __. ,.ooo~~. \ o`::::::|
# |::: . -. 88`78o/: \ `:::::|
# |::' /. o o \ :: \88`::::|
# |:; o|| 8 8 |d. `8 `:::|
# |:. - ^ ^ -' `-`::|
# |::. .:::|
# |:::::..... ::' ``::|
# |_________________________________|
#
# The force (push) is strong with this one...
push_command=$(ps -ocommand= -p $PPID)
is_force='force|\-f'
if [[ $push_command =~ $is_force ]]
then
echo "ICAgICBfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18NCiAgICB8Ojo6Ojo6Ojo6Ojo6Ojs7Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6fA0KICAgIHw6Ojo6Ojo6Ojo6Oid+fHx+fn5gYDo6Ojo6Ojo6Ojo6Ojp8DQogICAgfDo6Ojo6Ojo6JyAgIC4nOiAgICAgb2A6Ojo6Ojo6Ojo6OnwNCiAgICB8Ojo6Ojo6Oicgb28gfCB8byAgbyAgICA6Ojo6Ojo6Ojo6fA0KICAgIHw6Ojo6Ojo6IDggIC4nLicgICAgOCBvICA6Ojo6Ojo6Ojp8DQogICAgfDo6Ojo6OjogOCAgfCB8ICAgICA4ICAgIDo6Ojo6Ojo6OnwN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