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

[PATCH] git-submodule.sh: Support 'checkout' as a valid update command

From
Francesco Pretto <ceztko@gmail.com>
Date
Jan 6, 2014, 18:58 UTC
Message-ID
<1389034726-8744-1-git-send-email-ceztko@gmail.com>

According to "Documentation/gitmodules.txt", 'checkout' is a valid 'submodule.<name>.update' command. Also "git-submodule.sh" refers to it and processes it correctly. Reflecting commit 'ac1fbb' to support this syntax and also validate property values during 'update' command, issuing an error if the value found is unknown.

Signed-off-by: Francesco Pretto <ceztko@gmail.com>
---
 git-submodule.sh | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index 2677f2e..4a30087 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -622,7 +622,7 @@ cmd_init()
 		   test -z "$(git config submodule."$name".update)"
 		then
 			case "$upd" in
-			rebase | merge | none)
+			checkout | rebase | merge | none)
 				;; # known modes of updating
 			*)
 				echo >&2 "warning: unknown update mode '$upd' suggested for submodule '$name'"
@@ -805,6 +805,17 @@ cmd_update()
 			update_module=$update
 		else
 			update_module=$(git config submodule."$name".update)
+			case "$update_module" in
+			'')
+				;; # Unset update mode
+			checkout | rebase | merge | none)
+				;; # Known update modes
+			!*)
+				;; # Custom update command
+			*)
+				die "$(eval_gettext "Invalid update mode '$update_module' for submodule '$name'")"
+				;;
+			esac
 		fi
 
 		displaypath=$(relative_path "$prefix$sm_path")
-- 
1.8.5.2.229.g4448466.dirty
Next: Junio C Hamano
Message 1 of 6 in “git-submodule.sh: Support 'checkout' as a valid update command”
  1. git-submodule.sh: Support 'checkout' as a valid update commandFrancesco Pretto, Jan 6, 2014
  2. Junio C HamanoJan 6, 2014
  3. Francesco PrettoJan 7, 2014
  4. Junio C HamanoJan 7, 2014
  5. Francesco PrettoJan 7, 2014
  6. Francesco PrettoJan 7, 2014

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.