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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 &&



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux