@matheusbsbs / matheus-bagliano / commits / 23a485e3ee
Fork 0

git-submodule: rename shell functions for consistency

This renames the shell functions used in git-submodule that implement top-level subcommands. The rule is that the subcommand $foo is implemented by cmd_$foo function. A noteworthy change is that modules_list() is now known as cmd_status(). There is no "submodule list" command. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Jan 15, 2008 at 02:35 UTC 23a485e3ee32a9445e1c20bd4fd4b93119cd4f7c
1 file changed +10 -10
git-submodule.sh
+10 -10
@@ -86,9 +86,9 @@ module_name()
86 #
87 # Clone a submodule
88 #
89 -# Prior to calling, modules_update checks that a possibly existing
89 +# Prior to calling, cmd_update checks that a possibly existing
90 # path is not a git repository.
91 -# Likewise, module_add checks that path does not exist at all,
91 +# Likewise, cmd_add checks that path does not exist at all,
92 # since it is the location of a new submodule.
93 #
94 module_clone()
@@ -121,7 +121,7 @@ module_clone()
121 #
122 # optional branch is stored in global branch variable
123 #
124 -module_add()
124 +cmd_add()
125 {
126 repo=$1
127 path=$2
@@ -174,7 +174,7 @@ module_add()
174 #
175 # $@ = requested paths (default to all)
176 #
177 -modules_init()
177 +cmd_init()
178 {
179 git ls-files --stage -- "$@" | grep -e '^160000 ' |
180 while read mode sha1 stage path
@@ -207,7 +207,7 @@ modules_init()
207 #
208 # $@ = requested paths (default to all)
209 #
210 -modules_update()
210 +cmd_update()
211 {
212 git ls-files --stage -- "$@" | grep -e '^160000 ' |
213 while read mode sha1 stage path
@@ -266,7 +266,7 @@ set_name_rev () {
266 #
267 # $@ = requested paths (default to all)
268 #
269 -modules_list()
269 +cmd_status()
270 {
271 git ls-files --stage -- "$@" | grep -e '^160000 ' |
272 while read mode sha1 stage path
@@ -347,16 +347,16 @@ esac
347
348 case "$add,$init,$update,$status,$cached" in
349 1,,,,)
350 - module_add "$@"
350 + cmd_add "$@"
351 ;;
352 ,1,,,)
353 - modules_init "$@"
353 + cmd_init "$@"
354 ;;
355 ,,1,,)
356 - modules_update "$@"
356 + cmd_update "$@"
357 ;;
358 ,,,*,*)
359 - modules_list "$@"
359 + cmd_status "$@"
360 ;;
361 *)
362 usage