submodule, repack: migrate to git-sh-setup's say()

Now that there is say() in git-sh-setup, these scripts don't need to use
their own. Migrate them over by setting GIT_QUIET and removing their
custom say() functions.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Stephen Boyd 2009-06-16 15:33:00 -07:00 коммит произвёл Junio C Hamano
Родитель e064c170b4
Коммит 2e6a30ef8f
2 изменённых файлов: 11 добавлений и 25 удалений

Просмотреть файл

@ -24,7 +24,7 @@ SUBDIRECTORY_OK='Yes'
. git-sh-setup . git-sh-setup
no_update_info= all_into_one= remove_redundant= unpack_unreachable= no_update_info= all_into_one= remove_redundant= unpack_unreachable=
local= quiet= no_reuse= extra= local= no_reuse= extra=
while test $# != 0 while test $# != 0
do do
case "$1" in case "$1" in
@ -33,7 +33,7 @@ do
-A) all_into_one=t -A) all_into_one=t
unpack_unreachable=--unpack-unreachable ;; unpack_unreachable=--unpack-unreachable ;;
-d) remove_redundant=t ;; -d) remove_redundant=t ;;
-q) quiet=-q ;; -q) GIT_QUIET=t ;;
-f) no_reuse=--no-reuse-object ;; -f) no_reuse=--no-reuse-object ;;
-l) local=--local ;; -l) local=--local ;;
--max-pack-size|--window|--window-memory|--depth) --max-pack-size|--window|--window-memory|--depth)
@ -80,13 +80,11 @@ case ",$all_into_one," in
;; ;;
esac esac
args="$args $local $quiet $no_reuse$extra" args="$args $local ${GIT_QUIET:+-q} $no_reuse$extra"
names=$(git pack-objects --honor-pack-keep --non-empty --all --reflog $args </dev/null "$PACKTMP") || names=$(git pack-objects --honor-pack-keep --non-empty --all --reflog $args </dev/null "$PACKTMP") ||
exit 1 exit 1
if [ -z "$names" ]; then if [ -z "$names" ]; then
if test -z "$quiet"; then say Nothing new to pack.
echo Nothing new to pack.
fi
fi fi
# Ok we have prepared all new packfiles. # Ok we have prepared all new packfiles.
@ -176,7 +174,7 @@ then
done done
) )
fi fi
git prune-packed $quiet git prune-packed ${GIT_QUIET:+-q}
fi fi
case "$no_update_info" in case "$no_update_info" in

Просмотреть файл

@ -14,23 +14,11 @@ require_work_tree
command= command=
branch= branch=
quiet=
reference= reference=
cached= cached=
nofetch= nofetch=
update= update=
#
# print stuff on stdout unless -q was specified
#
say()
{
if test -z "$quiet"
then
echo "$@"
fi
}
# Resolve relative url by appending to parent's url # Resolve relative url by appending to parent's url
resolve_relative_url () resolve_relative_url ()
{ {
@ -137,7 +125,7 @@ cmd_add()
shift shift
;; ;;
-q|--quiet) -q|--quiet)
quiet=1 GIT_QUIET=1
;; ;;
--reference) --reference)
case "$2" in '') usage ;; esac case "$2" in '') usage ;; esac
@ -273,7 +261,7 @@ cmd_init()
do do
case "$1" in case "$1" in
-q|--quiet) -q|--quiet)
quiet=1 GIT_QUIET=1
;; ;;
--) --)
shift shift
@ -333,7 +321,7 @@ cmd_update()
case "$1" in case "$1" in
-q|--quiet) -q|--quiet)
shift shift
quiet=1 GIT_QUIET=1
;; ;;
-i|--init) -i|--init)
init=1 init=1
@ -650,7 +638,7 @@ cmd_status()
do do
case "$1" in case "$1" in
-q|--quiet) -q|--quiet)
quiet=1 GIT_QUIET=1
;; ;;
--cached) --cached)
cached=1 cached=1
@ -704,7 +692,7 @@ cmd_sync()
do do
case "$1" in case "$1" in
-q|--quiet) -q|--quiet)
quiet=1 GIT_QUIET=1
shift shift
;; ;;
--) --)
@ -759,7 +747,7 @@ do
command=$1 command=$1
;; ;;
-q|--quiet) -q|--quiet)
quiet=1 GIT_QUIET=1
;; ;;
-b|--branch) -b|--branch)
case "$2" in case "$2" in