Thread (4 messages) flat view 4 messages, 2 authors, 2016-06-15
STALE3738d

Revision rfc of 2 in this series.

Revisions (2)
  1. rfc current
  2. v1 [diff vs current]

[RFC PATCH 2/2] add update 'none' flag to disable update of submodule by default

From: Heiko Voigt <hidden>
Date: 2016-06-15 22:51:25
Subsystem: the rest · Maintainer: Linus Torvalds

This is useful to mark a submodule as unneeded by default. When this
option is set and the user wants to work with such a submodule he
needs to configure 'submodule.<name>.update=checkout' or pass the
--checkout option. Then the submodule can be handled like a normal
submodule.

TODO: Documentation/Tests
---
 git-submodule.sh |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index 70dfc7b..77977b5 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -423,6 +423,9 @@ cmd_update()
 		--recursive)
 			recursive=1
 			;;
+		--checkout)
+			update="checkout"
+			;;
 		--)
 			shift
 			break
@@ -461,6 +464,12 @@ cmd_update()
 			update_module=$(git config submodule."$name".update)
 		fi
 
+		if test "$update_module" = "none"
+		then
+			echo "Skipping submodule '$path'"
+			continue
+		fi
+
 		if test -z "$url"
 		then
 			# Only mention uninitialized submodules when its
-- 
1.7.5.1.219.g4c6b2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help