Skip to content

Commit 2eec463

Browse files
avargitster
authored andcommitted
git-submodule.sh: use "$quiet", not "$GIT_QUIET"
Remove the use of the "$GIT_QUIET" variable in favor of our own "$quiet", ever since b3c5f5c (submodule: move core cmd_update() logic to C, 2022-03-15) we have not used the "say" function in git-sh-setup.sh, which is the only thing that's affected by using "GIT_QUIET". We still want to support --quiet for our own use though, but let's use our own variable for that. Now it's obvious that we only care about passing "--quiet" to "git submodule--helper", and not to change the output of any "say" invocation. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b788fc6 commit 2eec463

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

git-submodule.sh

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ GIT_PROTOCOL_FROM_USER=0
3030
export GIT_PROTOCOL_FROM_USER
3131

3232
command=
33+
quiet=
3334
branch=
3435
force=
3536
reference=
@@ -80,7 +81,7 @@ cmd_add()
8081
force=$1
8182
;;
8283
-q|--quiet)
83-
GIT_QUIET=1
84+
quiet=1
8485
;;
8586
--progress)
8687
progress=1
@@ -128,7 +129,7 @@ cmd_add()
128129
usage
129130
fi
130131

131-
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper add ${GIT_QUIET:+--quiet} ${force:+--force} ${progress:+"--progress"} ${branch:+--branch "$branch"} ${reference_path:+--reference "$reference_path"} ${dissociate:+--dissociate} ${custom_name:+--name "$custom_name"} ${depth:+"$depth"} -- "$@"
132+
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper add ${quiet:+--quiet} ${force:+--force} ${progress:+"--progress"} ${branch:+--branch "$branch"} ${reference_path:+--reference "$reference_path"} ${dissociate:+--dissociate} ${custom_name:+--name "$custom_name"} ${depth:+"$depth"} -- "$@"
132133
}
133134

134135
#
@@ -144,7 +145,7 @@ cmd_foreach()
144145
do
145146
case "$1" in
146147
-q|--quiet)
147-
GIT_QUIET=1
148+
quiet=1
148149
;;
149150
--recursive)
150151
recursive=1
@@ -159,7 +160,7 @@ cmd_foreach()
159160
shift
160161
done
161162

162-
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper foreach ${GIT_QUIET:+--quiet} ${recursive:+--recursive} -- "$@"
163+
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper foreach ${quiet:+--quiet} ${recursive:+--recursive} -- "$@"
163164
}
164165

165166
#
@@ -174,7 +175,7 @@ cmd_init()
174175
do
175176
case "$1" in
176177
-q|--quiet)
177-
GIT_QUIET=1
178+
quiet=1
178179
;;
179180
--)
180181
shift
@@ -190,7 +191,7 @@ cmd_init()
190191
shift
191192
done
192193

193-
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper init ${GIT_QUIET:+--quiet} -- "$@"
194+
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper init ${quiet:+--quiet} -- "$@"
194195
}
195196

196197
#
@@ -207,7 +208,7 @@ cmd_deinit()
207208
force=$1
208209
;;
209210
-q|--quiet)
210-
GIT_QUIET=1
211+
quiet=1
211212
;;
212213
--all)
213214
deinit_all=t
@@ -226,7 +227,7 @@ cmd_deinit()
226227
shift
227228
done
228229

229-
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper deinit ${GIT_QUIET:+--quiet} ${force:+--force} ${deinit_all:+--all} -- "$@"
230+
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper deinit ${quiet:+--quiet} ${force:+--force} ${deinit_all:+--all} -- "$@"
230231
}
231232

232233
#
@@ -241,7 +242,7 @@ cmd_update()
241242
do
242243
case "$1" in
243244
-q|--quiet)
244-
GIT_QUIET=1
245+
quiet=1
245246
;;
246247
--progress)
247248
progress=1
@@ -335,7 +336,7 @@ cmd_update()
335336
done
336337

337338
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper update \
338-
${GIT_QUIET:+--quiet} \
339+
${quiet:+--quiet} \
339340
${force:+--force} \
340341
${progress:+"--progress"} \
341342
${remote:+--remote} \
@@ -396,7 +397,7 @@ cmd_set_branch() {
396397
shift
397398
done
398399

399-
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper set-branch ${GIT_QUIET:+--quiet} ${branch:+--branch "$branch"} ${default:+--default} -- "$@"
400+
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper set-branch ${quiet:+--quiet} ${branch:+--branch "$branch"} ${default:+--default} -- "$@"
400401
}
401402

402403
#
@@ -409,7 +410,7 @@ cmd_set_url() {
409410
do
410411
case "$1" in
411412
-q|--quiet)
412-
GIT_QUIET=1
413+
quiet=1
413414
;;
414415
--)
415416
shift
@@ -425,7 +426,7 @@ cmd_set_url() {
425426
shift
426427
done
427428

428-
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper set-url ${GIT_QUIET:+--quiet} -- "$@"
429+
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper set-url ${quiet:+--quiet} -- "$@"
429430
}
430431

431432
#
@@ -496,7 +497,7 @@ cmd_status()
496497
do
497498
case "$1" in
498499
-q|--quiet)
499-
GIT_QUIET=1
500+
quiet=1
500501
;;
501502
--cached)
502503
cached=1
@@ -518,7 +519,7 @@ cmd_status()
518519
shift
519520
done
520521

521-
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper status ${GIT_QUIET:+--quiet} ${cached:+--cached} ${recursive:+--recursive} -- "$@"
522+
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper status ${quiet:+--quiet} ${cached:+--cached} ${recursive:+--recursive} -- "$@"
522523
}
523524
#
524525
# Sync remote urls for submodules
@@ -531,7 +532,7 @@ cmd_sync()
531532
do
532533
case "$1" in
533534
-q|--quiet)
534-
GIT_QUIET=1
535+
quiet=1
535536
shift
536537
;;
537538
--recursive)
@@ -551,7 +552,7 @@ cmd_sync()
551552
esac
552553
done
553554

554-
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper sync ${GIT_QUIET:+--quiet} ${recursive:+--recursive} -- "$@"
555+
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper sync ${quiet:+--quiet} ${recursive:+--recursive} -- "$@"
555556
}
556557

557558
cmd_absorbgitdirs()
@@ -572,7 +573,7 @@ do
572573
command=$1
573574
;;
574575
-q|--quiet)
575-
GIT_QUIET=1
576+
quiet=1
576577
;;
577578
--cached)
578579
cached=1

0 commit comments

Comments
 (0)