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

[PATCH v3 12/12] git-sh-setup.sh: remove "say" function, change last users

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 22, 2022, 14:28 UTC
Message-ID
<patch-v3-12.12-ecdd8c6ed28-20220622T142012Z-avarab@gmail.com>
In-Reply-To
<cover-v3-00.12-00000000000-20220622T142012Z-avarab@gmail.com>

Remove the "say" function, with various rewrites of the remaining git-*.sh code to C and the preceding change to have git-submodule.sh stop using the GIT_QUIET variable there were only four uses in git-subtree.sh. Let's have it use an "arg_quiet" variable instead, and move the "say" function over to it.

The only other use was a trivial message in git-instaweb.sh, since it has never supported the --quiet option (or similar) that code added in 0b624b4ceee (instaweb: restart server if already running, 2009-11-22) can simply use "echo" instead.

The remaining in-tree hits from "say" are all for the sibling function defined in t/test-lib.sh. It's safe to remove this function since it has never been documented in Documentation/git-sh-setup.txt.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 contrib/subtree/git-subtree.sh | 15 ++++++++++++---
 git-instaweb.sh                |  2 +-
 git-sh-setup.sh                |  9 ---------
 3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 1af1d9653e9..7562a395c24 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -50,6 +50,14 @@ m,message=    use the given message as the commit message for the merge commit
 
 indent=0
 
+# Usage: say [MSG...]
+say () {
+	if test -z "$arg_quiet"
+	then
+		printf '%s\n' "$*"
+	fi
+}
+
 # Usage: debug [MSG...]
 debug () {
 	if test -n "$arg_debug"
@@ -60,7 +68,7 @@ debug () {
 
 # Usage: progress [MSG...]
 progress () {
-	if test -z "$GIT_QUIET"
+	if test -z "$arg_quiet"
 	then
 		if test -z "$arg_debug"
 		then
@@ -146,6 +154,7 @@ main () {
 	eval "$set_args"
 
 	# Begin "real" flag parsing.
+	arg_quiet=
 	arg_debug=
 	arg_prefix=
 	arg_split_branch=
@@ -161,7 +170,7 @@ main () {
 
 		case "$opt" in
 		-q)
-			GIT_QUIET=1
+			arg_quiet=1
 			;;
 		-d)
 			arg_debug=1
@@ -252,7 +261,7 @@ main () {
 	dir="$(dirname "$arg_prefix/.")"
 
 	debug "command: {$arg_command}"
-	debug "quiet: {$GIT_QUIET}"
+	debug "quiet: {$arg_quiet}"
 	debug "dir: {$dir}"
 	debug "opts: {$*}"
 	debug
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 4349566c891..c68f49454cd 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -102,7 +102,7 @@ resolve_full_httpd () {
 
 start_httpd () {
 	if test -f "$fqgitdir/pid"; then
-		say "Instance already running. Restarting..."
+		echo "Instance already running. Restarting..."
 		stop_httpd
 	fi
 
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index ecb60d9e3cb..ce273fe0e48 100644
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -57,15 +57,6 @@ die_with_status () {
 	exit "$status"
 }
 
-GIT_QUIET=
-
-say () {
-	if test -z "$GIT_QUIET"
-	then
-		printf '%s\n' "$*"
-	fi
-}
-
 if test -n "$OPTIONS_SPEC"; then
 	usage() {
 		"$0" -h
-- 
2.36.1.1239.gfba91521d90
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 58 of 90 in “[RFC] submodule update: parse all options in C”
  1. 0/8 [RFC] submodule update: parse all options in CGlen Choo via GitGitGadget, Jun 10, 2022
  2. 1/8 submodule update: remove intermediate parsingGlen Choo via GitGitGadget, Jun 10, 2022
  3. 2/8 submodule update: pass options containing "[no-]"Glen Choo via GitGitGadget, Jun 10, 2022
  4. 3/8 submodule update: pass options with stuck formsGlen Choo via GitGitGadget, Jun 10, 2022
  5. 4/8 submodule update: pass --require-init and --initGlen Choo via GitGitGadget, Jun 10, 2022
  6. 5/8 submodule--helper update: use one param per typeGlen Choo via GitGitGadget, Jun 10, 2022
  7. 7/8 submodule update: stop parsing options in .shGlen Choo via GitGitGadget, Jun 10, 2022
  8. 8/8 submodule update: remove never-used expansionGlen Choo via GitGitGadget, Jun 10, 2022
  9. 6/8 submodule update: remove -v, pass --quietGlen Choo via GitGitGadget, Jun 10, 2022
  10. 00/20 submodule: remove git-submodule.sh, create bare builtin/submodule.cÆvar Arnfjörð Bjarmason, Jun 10, 2022
  11. 01/20 git-submodule.sh: remove unused sanitize_submodule_env()Ævar Arnfjörð Bjarmason, Jun 10, 2022
  12. 02/20 git-submodule.sh: remove unused $prefix variableÆvar Arnfjörð Bjarmason, Jun 10, 2022
  13. 04/20 git-submodule.sh: normalize parsing of "--branch"Ævar Arnfjörð Bjarmason, Jun 10, 2022
  14. 03/20 git-submodule.sh: remove unused --super-prefix logicÆvar Arnfjörð Bjarmason, Jun 10, 2022
  15. 05/20 git-submodule.sh: normalize parsing of --cachedÆvar Arnfjörð Bjarmason, Jun 10, 2022
  16. 06/20 submodule--helper: rename "absorb-git-dirs" to "absorbgitdirs"Ævar Arnfjörð Bjarmason, Jun 10, 2022
  17. 07/20 git-submodule.sh: create a "case" dispatch statementÆvar Arnfjörð Bjarmason, Jun 10, 2022
  18. 09/20 git-submodule.sh: dispatch "sync" to helperÆvar Arnfjörð Bjarmason, Jun 10, 2022
  19. 08/20 submodule--helper: pretend to be "git submodule" in "-h" outputÆvar Arnfjörð Bjarmason, Jun 10, 2022
  20. 10/20 git-submodule.sh: dispatch directly to helperÆvar Arnfjörð Bjarmason, Jun 10, 2022
  21. 12/20 submodule--helper: have --require-init imply --initÆvar Arnfjörð Bjarmason, Jun 10, 2022
  22. 11/20 git-submodule.sh: dispatch "foreach" to helperÆvar Arnfjörð Bjarmason, Jun 10, 2022
  23. 15/20 submodule--helper: understand -v option for "update"Ævar Arnfjörð Bjarmason, Jun 10, 2022
  24. 14/20 git-submodule doc: document the -v" option to "update"Ævar Arnfjörð Bjarmason, Jun 10, 2022
  25. 18/20 git-submodule.sh: simplify parsing loopÆvar Arnfjörð Bjarmason, Jun 10, 2022
  26. 20/20 submodule: add a subprocess-less submodule.useBuiltin settingÆvar Arnfjörð Bjarmason, Jun 10, 2022
  27. 19/20 submodule: make it a built-in, remove git-submodule.shÆvar Arnfjörð Bjarmason, Jun 10, 2022
  28. 17/20 git-submodule.sh: use "$quiet", not "$GIT_QUIET"Ævar Arnfjörð Bjarmason, Jun 10, 2022
  29. 13/20 submodule--helper: understand --checkout, --merge and --rebase synonymsÆvar Arnfjörð Bjarmason, Jun 10, 2022
  30. 16/20 git-submodule.sh: dispatch "update" to helperÆvar Arnfjörð Bjarmason, Jun 10, 2022
  31. Glen ChooJun 13, 2022
  32. 00/12 submodule: make "git submodule--helper" behave like "git submodule"Ævar Arnfjörð Bjarmason, Jun 13, 2022
  33. 01/12 git-submodule.sh: remove unused sanitize_submodule_env()Ævar Arnfjörð Bjarmason, Jun 13, 2022
  34. 02/12 git-submodule.sh: remove unused $prefix var and --super-prefixÆvar Arnfjörð Bjarmason, Jun 13, 2022
  35. 03/12 git-submodule.sh: make "$cached" variable a booleanÆvar Arnfjörð Bjarmason, Jun 13, 2022
  36. 04/12 git-submodule.sh: remove unused top-level "--branch" argumentÆvar Arnfjörð Bjarmason, Jun 13, 2022
  37. Glen ChooJun 15, 2022
  38. 05/12 submodule--helper: have --require-init imply --initÆvar Arnfjörð Bjarmason, Jun 13, 2022
  39. Glen ChooJun 15, 2022
  40. 06/12 submodule update: remove "-v" optionÆvar Arnfjörð Bjarmason, Jun 13, 2022
  41. Glen ChooJun 15, 2022
  42. 09/12 submodule--helper: understand --checkout, --merge and --rebase synonymsÆvar Arnfjörð Bjarmason, Jun 13, 2022
  43. 08/12 submodule--helper: report "submodule" as our name in "-h" outputÆvar Arnfjörð Bjarmason, Jun 13, 2022
  44. Glen ChooJun 15, 2022
  45. Glen ChooJun 15, 2022
  46. Ævar Arnfjörð BjarmasonJun 15, 2022
  47. 07/12 submodule--helper: rename "absorb-git-dirs" to "absorbgitdirs"Ævar Arnfjörð Bjarmason, Jun 13, 2022
  48. 11/12 git-submodule.sh: use "$quiet", not "$GIT_QUIET"Ævar Arnfjörð Bjarmason, Jun 13, 2022
  49. 12/12 git-sh-setup.sh: remove "say" function, change last usersÆvar Arnfjörð Bjarmason, Jun 13, 2022
  50. Glen ChooJun 15, 2022
  51. 10/12 submodule--helper: eliminate internal "--update" optionÆvar Arnfjörð Bjarmason, Jun 13, 2022
  52. Glen ChooJun 15, 2022
  53. Glen ChooJun 13, 2022
  54. Ævar Arnfjörð BjarmasonJun 13, 2022
  55. Glen ChooJun 15, 2022
  56. Glen ChooJun 15, 2022
  57. 00/12 submodule: make "git submodule--helper" behave like "git submodule"Ævar Arnfjörð Bjarmason, Jun 22, 2022
  58. 12/12 git-sh-setup.sh: remove "say" function, change last usersÆvar Arnfjörð Bjarmason, Jun 22, 2022
  59. 01/12 git-submodule.sh: remove unused sanitize_submodule_env()Ævar Arnfjörð Bjarmason, Jun 22, 2022
  60. 02/12 git-submodule.sh: remove unused $prefix var and --super-prefixÆvar Arnfjörð Bjarmason, Jun 22, 2022
  61. Glen ChooJun 22, 2022
  62. Ævar Arnfjörð BjarmasonJun 24, 2022
  63. Glen ChooJun 24, 2022
  64. 03/12 git-submodule.sh: make the "$cached" variable a booleanÆvar Arnfjörð Bjarmason, Jun 22, 2022
  65. 04/12 git-submodule.sh: remove unused top-level "--branch" argumentÆvar Arnfjörð Bjarmason, Jun 22, 2022
  66. 06/12 submodule update: remove "-v" optionÆvar Arnfjörð Bjarmason, Jun 22, 2022
  67. 05/12 submodule--helper: have --require-init imply --initÆvar Arnfjörð Bjarmason, Jun 22, 2022
  68. 10/12 submodule--helper: eliminate internal "--update" optionÆvar Arnfjörð Bjarmason, Jun 22, 2022
  69. 09/12 submodule--helper: understand --checkout, --merge and --rebase synonymsÆvar Arnfjörð Bjarmason, Jun 22, 2022
  70. Glen ChooJun 22, 2022
  71. Glen ChooJun 22, 2022
  72. 08/12 submodule--helper: report "submodule" as our name in some "-h" outputÆvar Arnfjörð Bjarmason, Jun 22, 2022
  73. Glen ChooJun 22, 2022
  74. 07/12 submodule--helper: rename "absorb-git-dirs" to "absorbgitdirs"Ævar Arnfjörð Bjarmason, Jun 22, 2022
  75. 11/12 git-submodule.sh: use "$quiet", not "$GIT_QUIET"Ævar Arnfjörð Bjarmason, Jun 22, 2022
  76. Glen ChooJun 24, 2022
  77. 00/12 submodule: make "git submodule--helper" behave like "git submodule"Ævar Arnfjörð Bjarmason, Jun 28, 2022
  78. 01/12 git-submodule.sh: remove unused sanitize_submodule_env()Ævar Arnfjörð Bjarmason, Jun 28, 2022
  79. 02/12 git-submodule.sh: remove unused $prefix variableÆvar Arnfjörð Bjarmason, Jun 28, 2022
  80. 03/12 git-submodule.sh: make the "$cached" variable a booleanÆvar Arnfjörð Bjarmason, Jun 28, 2022
  81. 08/12 submodule--helper: report "submodule" as our name in some "-h" outputÆvar Arnfjörð Bjarmason, Jun 28, 2022
  82. 07/12 submodule--helper: rename "absorb-git-dirs" to "absorbgitdirs"Ævar Arnfjörð Bjarmason, Jun 28, 2022
  83. 06/12 submodule update: remove "-v" optionÆvar Arnfjörð Bjarmason, Jun 28, 2022
  84. 12/12 git-sh-setup.sh: remove "say" function, change last usersÆvar Arnfjörð Bjarmason, Jun 28, 2022
  85. 04/12 git-submodule.sh: remove unused top-level "--branch" argumentÆvar Arnfjörð Bjarmason, Jun 28, 2022
  86. 05/12 submodule--helper: have --require-init imply --initÆvar Arnfjörð Bjarmason, Jun 28, 2022
  87. 10/12 submodule--helper: eliminate internal "--update" optionÆvar Arnfjörð Bjarmason, Jun 28, 2022
  88. 11/12 git-submodule.sh: use "$quiet", not "$GIT_QUIET"Ævar Arnfjörð Bjarmason, Jun 28, 2022
  89. 09/12 submodule--helper: understand --checkout, --merge and --rebase synonymsÆvar Arnfjörð Bjarmason, Jun 28, 2022
  90. Glen ChooJun 28, 2022

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.