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

[PATCH 0/7] submodule: fallback to .gitmodules and multiple level module definition

From
Ping Yin <pkufranky@gmail.com>
Date
Apr 16, 2008, 14:19 UTC
Message-ID
<1208355577-8734-1-git-send-email-pkufranky@gmail.com>

This is a resend of the RFC patches some days ago, with only minor code modification and log refinement. Also swap the order of the last two patches.

Since there is less feedback these days, i don't know much what you guys think of this patch series. However, i have use this series for a long time and think personally it is useful when having many submodules.

So i resend it, and look forward to its acceptance.
This patch series has following functional improvements for submodule
 - Fall back on .gitmodules if info not found in $GIT_DIR/config
 - multi-level module definition
 - Don't die when subcommand fails for one module
 Actually, they seems three independent improvements. But the first two
 improvements are both dependent on the first two refactoring patches
 and the 3rd improvement is dependent on the implementation of the
 first two improvements. So i have to send them in batch.

Patches 1,2,4 is mainly code refactor but the second one also has some semantic change.

The other patches do the real functional changes.
Ping Yin (7):
      git-submodule: Extract functions module_info and module_url
      git-submodule: Extract absolute_url & move absolute url logic to module_clone
      git-submodule: Fall back on .gitmodules if info not found in $GIT_DIR/config
      git-submodule: Extract module_add from cmd_add
      git-submodule: multi-level module definition
      git-submodule: "update --force" to enforce cloning non-submodule
      git-submodule: Don't die when command fails for one submodule
 git-submodule.sh           |  325 ++++++++++++++++++++++++++++++++------------
 t/t7400-submodule-basic.sh |   31 ++++-
 2 files changed, 266 insertions(+), 90 deletions(-)
Following is the diff with former RFC patch series
diff --git a/git-submodule.sh b/git-submodule.sh
index 8bea97a..0ecc4ff 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -354,7 +354,7 @@ cmd_init()
 		exit_status=1 &&
 		continue
 		# Skip already registered paths
-		git config submodule.$name.url && continue
+		test -z "$(git config submodule.$name.url)" || continue
 
 		url=$(absolute_url "$url")
 		git config submodule."$name".url "$url" ||
@@ -442,7 +442,6 @@ cmd_update()
 			}
 		fi
 
-
 		if test "$subsha1" != "$sha1"
 		then
 			(unset GIT_DIR; cd "$path" && git-fetch &&
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index d9b48f7..8b35ff8 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -187,7 +187,7 @@ test_expect_success 'status should be "modified" after submodule reset --hard HE
 	git-submodule status | grep "^+$rev2"
 '
 
-test_expect_success 'update should checkout rev1 when fall back' '
+test_expect_success 'update should checkout rev1 with falling back' '
 	git-config --unset submodule.example.url &&
 	GIT_CONFIG=.gitmodules git config submodule.example.url .subrepo &&
 	git-submodule update init &&
Next: Ping Yin
Message 1 of 18 in “submodule: fallback to .gitmodules and multiple level module definition”
  1. 0/7 submodule: fallback to .gitmodules and multiple level module definitionPing Yin, Apr 16, 2008
  2. 1/7 git-submodule: Extract functions module_info and module_urlPing Yin, Apr 16, 2008
  3. 2/7 git-submodule: Extract absolute_url & move absolute url logic to module_clonePing Yin, Apr 16, 2008
  4. 3/7 git-submodule: Fall back on .gitmodules if info not found in $GIT_DIR/configPing Yin, Apr 16, 2008
  5. 4/7 git-submodule: Extract module_add from cmd_addPing Yin, Apr 16, 2008
  6. 5/7 git-submodule: multi-level module definitionPing Yin, Apr 16, 2008
  7. 6/7 git-submodule: "update --force" to enforce cloning non-submodulePing Yin, Apr 16, 2008
  8. 7/7 git-submodule: Don't die when command fails for one submodulePing Yin, Apr 16, 2008
  9. Junio C HamanoApr 22, 2008
  10. Ping YinApr 22, 2008
  11. Junio C HamanoApr 22, 2008
  12. Ping YinApr 22, 2008
  13. Ping YinApr 22, 2008
  14. Ping YinApr 22, 2008
  15. Ping YinApr 22, 2008
  16. Ping YinApr 22, 2008
  17. Jakub NarebskiApr 22, 2008
  18. Ping YinApr 22, 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.