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

[PATCH v4 7/7] git-submodule.sh: rename some variables

From
RERoy Eldar <royeldar0@gmail.com>
Date
Dec 11, 2024, 06:32 UTC
Message-ID
<20241211063234.7610-8-royeldar0@gmail.com>
In-Reply-To
<20241211063234.7610-1-royeldar0@gmail.com>

Every switch and option which is passed to git-submodule.sh has a corresponding variable which is set accordingly; by convention, the name of the variable is the option name (for example, "--jobs" and "$jobs").

Rename "$custom_name", "$deinit_all" and "$nofetch", for consistency.
Signed-off-by: Roy Eldar <royeldar0@gmail.com>
---
 git-submodule.sh | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index 6df25efc48..2999b31fad 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -40,11 +40,11 @@ init=
 require_init=
 files=
 remote=
-nofetch=
+no_fetch=
 rebase=
 merge=
 checkout=
-custom_name=
+name=
 depth=
 progress=
 dissociate=
@@ -52,7 +52,7 @@ single_branch=
 jobs=
 recommend_shallow=
 filter=
-deinit_all=
+all=
 default=
 summary_limit=
 for_status=
@@ -108,11 +108,11 @@ cmd_add()
 			;;
 		--name)
 			case "$2" in '') usage ;; esac
-			custom_name="--name=$2"
+			name="--name=$2"
 			shift
 			;;
 		--name=*)
-			custom_name="$1"
+			name="$1"
 			;;
 		--depth)
 			case "$2" in '') usage ;; esac
@@ -149,7 +149,7 @@ cmd_add()
 		${reference:+"$reference"} \
 		${ref_format:+"$ref_format"} \
 		$dissociate \
-		${custom_name:+"$custom_name"} \
+		${name:+"$name"} \
 		${depth:+"$depth"} \
 		-- \
 		"$@"
@@ -240,7 +240,7 @@ cmd_deinit()
 			quiet=$1
 			;;
 		--all)
-			deinit_all=$1
+			all=$1
 			;;
 		--)
 			shift
@@ -259,7 +259,7 @@ cmd_deinit()
 	git ${wt_prefix:+-C "$wt_prefix"} submodule--helper deinit \
 		$quiet \
 		$force \
-		$deinit_all \
+		$all \
 		-- \
 		"$@"
 }
@@ -294,7 +294,7 @@ cmd_update()
 			remote=$1
 			;;
 		-N|--no-fetch)
-			nofetch=$1
+			no_fetch=$1
 			;;
 		-f|--force)
 			force=$1
@@ -381,7 +381,7 @@ cmd_update()
 		$remote \
 		$recursive \
 		$init \
-		$nofetch \
+		$no_fetch \
 		$rebase \
 		$merge \
 		$checkout \
-- 
2.30.2
Previous: Roy Eldar
Message 43 of 43 in “git-submodule.sh: improve parsing of options”
  1. 0/3 git-submodule.sh: improve parsing of optionsRoy Eldar, Dec 7, 2024
  2. 1/3 git-submodule.sh: make some variables booleanRoy Eldar, Dec 7, 2024
  3. Junio C HamanoDec 7, 2024
  4. Eric SunshineDec 8, 2024
  5. 2/3 git-submodule.sh: improve parsing of some long optionsRoy Eldar, Dec 7, 2024
  6. 3/3 git-submodule.sh: improve parsing of short optionsRoy Eldar, Dec 7, 2024
  7. Junio C HamanoDec 8, 2024
  8. Roy EDec 9, 2024
  9. 0/8 git-submodule.sh: improve parsing of optionsRoy Eldar, Dec 9, 2024
  10. 1/8 git-submodule.sh: make some variables booleanRoy Eldar, Dec 9, 2024
  11. 2/8 git-submodule.sh: improve parsing of some long optionsRoy Eldar, Dec 9, 2024
  12. 3/8 git-submodule.sh: improve parsing of short optionsRoy Eldar, Dec 9, 2024
  13. 4/8 git-submodule.sh: get rid of isnumberRoy Eldar, Dec 9, 2024
  14. 5/8 git-submodule.sh: get rid of unused variableRoy Eldar, Dec 9, 2024
  15. 6/8 git-submodule.sh: add some commentsRoy Eldar, Dec 9, 2024
  16. 7/8 git-submodule.sh: improve variables readabilityRoy Eldar, Dec 9, 2024
  17. 8/8 git-submodule.sh: rename some variablesRoy Eldar, Dec 9, 2024
  18. Junio C HamanoDec 9, 2024
  19. Junio C HamanoDec 10, 2024
  20. Roy EDec 10, 2024
  21. Junio C HamanoDec 11, 2024
  22. Roy EDec 11, 2024
  23. Junio C HamanoDec 11, 2024
  24. 0/7 git-submodule.sh: improve parsing of optionsRoy Eldar, Dec 10, 2024
  25. 1/7 git-submodule.sh: improve parsing of some long optionsRoy Eldar, Dec 10, 2024
  26. 2/7 git-submodule.sh: improve parsing of short optionsRoy Eldar, Dec 10, 2024
  27. 3/7 git-submodule.sh: get rid of isnumberRoy Eldar, Dec 10, 2024
  28. 4/7 git-submodule.sh: get rid of unused variableRoy Eldar, Dec 10, 2024
  29. 5/7 git-submodule.sh: add some commentsRoy Eldar, Dec 10, 2024
  30. 6/7 git-submodule.sh: improve variables readabilityRoy Eldar, Dec 10, 2024
  31. Junio C HamanoDec 11, 2024
  32. Roy EDec 11, 2024
  33. Đoàn Trần Công DanhDec 11, 2024
  34. Junio C HamanoDec 11, 2024
  35. 7/7 git-submodule.sh: rename some variablesRoy Eldar, Dec 10, 2024
  36. 0/7 git-submodule.sh: improve parsing of optionsRoy Eldar, Dec 11, 2024
  37. 1/7 git-submodule.sh: improve parsing of some long optionsRoy Eldar, Dec 11, 2024
  38. 2/7 git-submodule.sh: improve parsing of short optionsRoy Eldar, Dec 11, 2024
  39. 3/7 git-submodule.sh: get rid of isnumberRoy Eldar, Dec 11, 2024
  40. 4/7 git-submodule.sh: get rid of unused variableRoy Eldar, Dec 11, 2024
  41. 5/7 git-submodule.sh: add some commentsRoy Eldar, Dec 11, 2024
  42. 6/7 git-submodule.sh: improve variables readabilityRoy Eldar, Dec 11, 2024
  43. 7/7 git-submodule.sh: rename some variablesRoy Eldar, Dec 11, 2024

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.