git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] - Added pre command and custom argument support to git submodule recurse command

From
imyousuf@gmail.com <imyousuf@gmail.com>
Date
Mar 6, 2008, 07:33 UTC
Message-ID
<1204788817-22720-4-git-send-email-imyousuf@gmail.com>
In-Reply-To
<1204788817-22720-3-git-send-email-imyousuf@gmail.com>

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>
---
 * We could probably do something like this.  This first part is
   about making the command dispatcher maintainable.
   Note that I haven't seriously tested this series.  This and
   the next one are primarily to illustrate what I think the fix
   you are trying should look like.
 git-submodule.sh |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index ad9fe62..3c104e3 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -86,9 +86,9 @@ module_name()
 #
 # 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()
@@ -121,7 +121,7 @@ module_clone()
 #
 # optional branch is stored in global branch variable
 #
-module_add()
+cmd_add()
 {
        repo=$1
        path=$2
@@ -174,7 +174,7 @@ module_add()
 #
 # $@ = requested paths (default to all)
 #
-modules_init()
+cmd_init()
 {
        git ls-files --stage -- "$@" | grep -e '^160000 ' |
        while read mode sha1 stage path
@@ -207,7 +207,7 @@ modules_init()
 #
 # $@ = requested paths (default to all)
 #
-modules_update()
+cmd_update()
 {
        git ls-files --stage -- "$@" | grep -e '^160000 ' |
        while read mode sha1 stage path
@@ -266,7 +266,7 @@ set_name_rev () {
 #
 # $@ = requested paths (default to all)
 #
-modules_list()
+cmd_status()
 {
        git ls-files --stage -- "$@" | grep -e '^160000 ' |
        while read mode sha1 stage path
@@ -347,16 +347,16 @@ esac

 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
--
1.5.3.7
Previous: imyousuf@gmail.comNext: imyousuf@gmail.com
Message 4 of 8 in “- Added command synopsis in code and edited them in manual”
  1. - Added command synopsis in code and edited them in manualimyousuf@gmail.com, Mar 6, 2008
  2. - Added 'recurse' subcommand to git submoduleimyousuf@gmail.com, Mar 6, 2008
  3. - Added pre command and custom argument support to git submodule recurse commandimyousuf@gmail.com, Mar 6, 2008
  4. - Added pre command and custom argument support to git submodule recurse commandimyousuf@gmail.com, Mar 6, 2008
  5. - Added pre command and custom argument support to git submodule recurse commandimyousuf@gmail.com, Mar 6, 2008
  6. Junio C HamanoMar 6, 2008
  7. Junio C HamanoMar 6, 2008
  8. Junio C HamanoMar 6, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.