@matheusbsbs / matheus-bagliano / commits / 0842acff57
Fork 0

Customize git command for installations that lack certain commands.

When the platform lacks certain git subcommands, omit them from the list of subcommands that are available from "git" wrapper. Noticed by Geert Bosch. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Oct 2, 2005 at 00:20 UTC 0842acff57f386ba749c3ea6b5e034771f074f6b
2 files changed +50 -12
Makefile
+6 -1
@@ -122,6 +122,8 @@ PROGRAMS = \
122 # Backward compatibility -- to be removed after 1.0
123 PROGRAMS += git-ssh-pull git-ssh-push
124
125 +GIT_LIST_TWEAK =
126 +
127 PYMODULES = \
128 gitMergeCommon.py
129
@@ -131,6 +133,8 @@ endif
133
134 ifdef WITH_SEND_EMAIL
135 SCRIPT_PERL += git-send-email.perl
136 +else
137 + GIT_LIST_TWEAK += -e '/^send-email$$/d'
138 endif
139
140 LIB_FILE=libgit.a
@@ -282,7 +286,8 @@ all:
286 git: git.sh Makefile
287 rm -f $@+ $@
288 sed -e '1s|#!.*/sh|#!$(SHELL_PATH)|' \
285 - -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' <$@.sh >$@+
289 + -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
290 + $(GIT_LIST_TWEAK) <$@.sh >$@+
291 chmod +x $@+
292 mv $@+ $@
293
git.sh
+44 -11
@@ -16,17 +16,50 @@ esac
16
17 echo "Usage: git COMMAND [OPTIONS] [TARGET]"
18 if [ -n "$cmd" ]; then
19 - echo " git command '$cmd' not found: commands are:"
20 -else
21 - echo " git commands are:"
19 + echo "git command '$cmd' not found."
20 fi
21 +echo "git commands are:"
22
24 -cat <<\EOF
25 - add apply archimport bisect branch checkout cherry clone
26 - commit count-objects cvsimport diff fetch format-patch
27 - fsck-cache get-tar-commit-id init-db log ls-remote octopus
28 - pack-objects parse-remote patch-id prune pull push rebase
29 - relink rename repack request-pull reset resolve revert
30 - send-email shortlog show-branch status tag verify-tag
31 - whatchanged
23 +fmt <<\EOF | sed -e 's/^/ /'
24 +add
25 +apply
26 +archimport
27 +bisect
28 +branch
29 +checkout
30 +cherry
31 +clone
32 +commit
33 +count-objects
34 +cvsimport
35 +diff
36 +fetch
37 +format-patch
38 +fsck-objects
39 +get-tar-commit-id
40 +init-db
41 +log
42 +ls-remote
43 +octopus
44 +pack-objects
45 +parse-remote
46 +patch-id
47 +prune
48 +pull
49 +push
50 +rebase
51 +relink
52 +rename
53 +repack
54 +request-pull
55 +reset
56 +resolve
57 +revert
58 +send-email
59 +shortlog
60 +show-branch
61 +status
62 +tag
63 +verify-tag
64 +whatchanged
65 EOF