git-sh-setup.sh: remove "say" function, change last users

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> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Jun 28, 2022 at 12:05 UTC 5b893f7d81eb7feb43662ed8663e2af76a76b4c8
3 files changed +13 -13
contrib/subtree/git-subtree.sh
+12 -3
@@ -50,6 +50,14 @@ m,message= use the given message as the commit message for the merge commit
50
51 indent=0
52
53 +# Usage: say [MSG...]
54 +say () {
55 + if test -z "$arg_quiet"
56 + then
57 + printf '%s\n' "$*"
58 + fi
59 +}
60 +
61 # Usage: debug [MSG...]
62 debug () {
63 if test -n "$arg_debug"
@@ -60,7 +68,7 @@ debug () {
68
69 # Usage: progress [MSG...]
70 progress () {
63 - if test -z "$GIT_QUIET"
71 + if test -z "$arg_quiet"
72 then
73 if test -z "$arg_debug"
74 then
@@ -146,6 +154,7 @@ main () {
154 eval "$set_args"
155
156 # Begin "real" flag parsing.
157 + arg_quiet=
158 arg_debug=
159 arg_prefix=
160 arg_split_branch=
@@ -161,7 +170,7 @@ main () {
170
171 case "$opt" in
172 -q)
164 - GIT_QUIET=1
173 + arg_quiet=1
174 ;;
175 -d)
176 arg_debug=1
@@ -252,7 +261,7 @@ main () {
261 dir="$(dirname "$arg_prefix/.")"
262
263 debug "command: {$arg_command}"
255 - debug "quiet: {$GIT_QUIET}"
264 + debug "quiet: {$arg_quiet}"
265 debug "dir: {$dir}"
266 debug "opts: {$*}"
267 debug
git-instaweb.sh
+1 -1
@@ -102,7 +102,7 @@ resolve_full_httpd () {
102
103 start_httpd () {
104 if test -f "$fqgitdir/pid"; then
105 - say "Instance already running. Restarting..."
105 + echo "Instance already running. Restarting..."
106 stop_httpd
107 fi
108
git-sh-setup.sh
-9
@@ -57,15 +57,6 @@ die_with_status () {
57 exit "$status"
58 }
59
60 -GIT_QUIET=
61 -
62 -say () {
63 - if test -z "$GIT_QUIET"
64 - then
65 - printf '%s\n' "$*"
66 - fi
67 -}
68 -
60 if test -n "$OPTIONS_SPEC"; then
61 usage() {
62 "$0" -h