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

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

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Jun 6, 2011, 20:57 UTC
Message-ID
<6d70cfcf08e7ff99d090a3d0e4f730e4f638d050.1307374519.git.hvoigt@hvoigt.net>
In-Reply-To
<cover.1307374519.git.hvoigt@hvoigt.net>

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
Previous: Heiko VoigtNext: Jens Lehmann
Message 3 of 4 in “Add an update=none option for 'loose' submodules”
  1. 0/2 Add an update=none option for 'loose' submodulesHeiko Voigt, Jun 6, 2011
  2. 1/2 submodule: move update configuration variable further upHeiko Voigt, Jun 6, 2011
  3. 2/2 add update 'none' flag to disable update of submodule by defaultHeiko Voigt, Jun 6, 2011
  4. Jens LehmannJun 9, 2011

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.