Revision 5c5dc2fb51ad43100881d563a9d07ac1b70a5607 authored by Linus Torvalds on 08 July 2005, 22:59:29 UTC, committed by Linus Torvalds on 08 July 2005, 22:59:29 UTC
Sure, "install" will default to installing it executable anyway, but
this is the right thing to do.
1 parent ba375ac
Raw File
git
#!/bin/sh
cmd="$1"
shift
if which git-$cmd-script >& /dev/null
then
	exec git-$cmd-script "$@"
fi

if which git-$cmd >& /dev/null
then
	exec git-$cmd "$@"
fi

alternatives=($(echo $PATH | tr ':' '\n' | while read i; do ls $i/git-*-script 2> /dev/null; done))

echo Git command "'$cmd'" not found. Try one of
for i in "${alternatives[@]}"; do
	echo $i | sed 's:^.*/git-:   :' | sed 's:-script$::'
done | sort | uniq
back to top