Skip to content

Commit 5b893f7

Browse files
avargitster
authored andcommitted
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 0b624b4 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2eec463 commit 5b893f7

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

contrib/subtree/git-subtree.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ m,message= use the given message as the commit message for the merge commit
5050

5151
indent=0
5252

53+
# Usage: say [MSG...]
54+
say () {
55+
if test -z "$arg_quiet"
56+
then
57+
printf '%s\n' "$*"
58+
fi
59+
}
60+
5361
# Usage: debug [MSG...]
5462
debug () {
5563
if test -n "$arg_debug"
@@ -60,7 +68,7 @@ debug () {
6068

6169
# Usage: progress [MSG...]
6270
progress () {
63-
if test -z "$GIT_QUIET"
71+
if test -z "$arg_quiet"
6472
then
6573
if test -z "$arg_debug"
6674
then
@@ -146,6 +154,7 @@ main () {
146154
eval "$set_args"
147155

148156
# Begin "real" flag parsing.
157+
arg_quiet=
149158
arg_debug=
150159
arg_prefix=
151160
arg_split_branch=
@@ -161,7 +170,7 @@ main () {
161170

162171
case "$opt" in
163172
-q)
164-
GIT_QUIET=1
173+
arg_quiet=1
165174
;;
166175
-d)
167176
arg_debug=1
@@ -252,7 +261,7 @@ main () {
252261
dir="$(dirname "$arg_prefix/.")"
253262

254263
debug "command: {$arg_command}"
255-
debug "quiet: {$GIT_QUIET}"
264+
debug "quiet: {$arg_quiet}"
256265
debug "dir: {$dir}"
257266
debug "opts: {$*}"
258267
debug

git-instaweb.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ resolve_full_httpd () {
102102

103103
start_httpd () {
104104
if test -f "$fqgitdir/pid"; then
105-
say "Instance already running. Restarting..."
105+
echo "Instance already running. Restarting..."
106106
stop_httpd
107107
fi
108108

git-sh-setup.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,6 @@ die_with_status () {
5757
exit "$status"
5858
}
5959
60-
GIT_QUIET=
61-
62-
say () {
63-
if test -z "$GIT_QUIET"
64-
then
65-
printf '%s\n' "$*"
66-
fi
67-
}
68-
6960
if test -n "$OPTIONS_SPEC"; then
7061
usage() {
7162
"$0" -h

0 commit comments

Comments
 (0)