Better handling of exec extension in the git wrapper script
[git.git] / git.sh
1 #!/bin/sh
2
3 cmd=
4 path=$(dirname $0)
5 case "$#" in
6 0)      ;;
7 *)      cmd="$1"
8         shift
9         case "$cmd" in
10         -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
11                 echo "git version @@GIT_VERSION@@"
12                 exit 0 ;;
13         esac
14         
15         test -x $path/git-$cmd && exec $path/git-$cmd "$@"
16         
17         case '@@X@@' in
18             '')
19                 ;;
20             *)
21                 test -x $path/git-$cmd@@X@@ && exec $path/git-$cmd@@X@@ "$@"
22                 ;;
23         esac
24         ;;
25 esac
26
27 echo "Usage: git COMMAND [OPTIONS] [TARGET]"
28 if [ -n "$cmd" ]; then
29     echo " git command '$cmd' not found: commands are:"
30 else
31     echo " git commands are:"
32 fi
33
34 cat <<\EOF
35     add apply archimport bisect branch checkout cherry clone
36     commit count-objects cvsimport diff fetch format-patch
37     fsck-cache get-tar-commit-id init-db log ls-remote octopus
38     pack-objects parse-remote patch-id prune pull push rebase
39     relink rename repack request-pull reset resolve revert
40     send-email shortlog show-branch status tag verify-tag
41     whatchanged
42 EOF