summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 36a189c)
raw | patch | inline | side by side (parent: 36a189c)
author | Junio C Hamano <gitster@pobox.com> | |
Tue, 15 Jan 2008 10:35:49 +0000 (02:35 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 21 Jan 2008 04:57:42 +0000 (20:57 -0800) |
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>
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>
git-submodule.sh | patch | blob | history |
diff --git a/git-submodule.sh b/git-submodule.sh
index ad9fe628fdf0f7d5a9a968abeb03d6213e3772d7..3c104e30f7f7eefac1df2e7e21a4eaf786f81fda 100755 (executable)
--- a/git-submodule.sh
+++ b/git-submodule.sh
#
# Clone a submodule
#
-# Prior to calling, modules_update checks that a possibly existing
+# Prior to calling, cmd_update checks that a possibly existing
# path is not a git repository.
-# Likewise, module_add checks that path does not exist at all,
+# Likewise, cmd_add checks that path does not exist at all,
# since it is the location of a new submodule.
#
module_clone()
#
# optional branch is stored in global branch variable
#
-module_add()
+cmd_add()
{
repo=$1
path=$2
#
# $@ = requested paths (default to all)
#
-modules_init()
+cmd_init()
{
git ls-files --stage -- "$@" | grep -e '^160000 ' |
while read mode sha1 stage path
#
# $@ = requested paths (default to all)
#
-modules_update()
+cmd_update()
{
git ls-files --stage -- "$@" | grep -e '^160000 ' |
while read mode sha1 stage path
#
# $@ = requested paths (default to all)
#
-modules_list()
+cmd_status()
{
git ls-files --stage -- "$@" | grep -e '^160000 ' |
while read mode sha1 stage path
case "$add,$init,$update,$status,$cached" in
1,,,,)
- module_add "$@"
+ cmd_add "$@"
;;
,1,,,)
- modules_init "$@"
+ cmd_init "$@"
;;
,,1,,)
- modules_update "$@"
+ cmd_update "$@"
;;
,,,*,*)
- modules_list "$@"
+ cmd_status "$@"
;;
*)
usage