Skip to content

Instantly share code, notes, and snippets.

@abock
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abock/1cc1aea0ce1ca01d8f92 to your computer and use it in GitHub Desktop.
Save abock/1cc1aea0ce1ca01d8f92 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
#
# alias make=path/to/this/script
#
# if you don't want Makefiles to touch your
# git submodules. Insane.
#
nogitdir="/tmp/nogitsubmodulesfrommake"
mkdir -p "$nogitdir"
git="$(which git)"
{ cat <<EOF
#!/usr/bin/env bash
if [ "\$1" = "submodule" ]; then
echo "*** INSANITY: someone is messing with git submodules in a Makefile"
echo "*** not running this command:"
echo "***"
echo "*** git \$*"
echo "***"
sleep 2
else
"$git" \$*
fi
EOF
} > "$nogitdir/git"
chmod +x "$nogitdir/git"
PATH="$nogitdir:$PATH" make $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment