Skip to content

Instantly share code, notes, and snippets.

@abock
Last active August 29, 2015 14:09
Show Gist options
  • Save abock/1cdd21adf1a7649c779b to your computer and use it in GitHub Desktop.
Save abock/1cdd21adf1a7649c779b to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
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