From: Stephen Boyd <bebarino@gmail.com>
To: git@vger.kernel.org
Cc: Thomas Adam <thomas.adam22@gmail.com>,
Junio C Hamano <gitster@pobox.com>,
Johannes Sixt <j.sixt@viscovery.net>
Subject: [PATCHv3 3/4] submodule, repack: migrate to git-sh-setup's say()
Date: Mon, 15 Jun 2009 19:05:04 -0700 [thread overview]
Message-ID: <1245117905-19351-4-git-send-email-bebarino@gmail.com> (raw)
In-Reply-To: <1245117905-19351-3-git-send-email-bebarino@gmail.com>
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>
---
git-repack.sh | 12 +++++-------
git-submodule.sh | 24 ++++++------------------
2 files changed, 11 insertions(+), 25 deletions(-)
diff --git a/git-repack.sh b/git-repack.sh
index 0868734..efb527c 100755
--- a/git-repack.sh
+++ b/git-repack.sh
@@ -24,7 +24,7 @@ SUBDIRECTORY_OK='Yes'
. git-sh-setup
no_update_info= all_into_one= remove_redundant= unpack_unreachable=
-local= quiet= no_reuse= extra=
+local= no_reuse= extra=
while test $# != 0
do
case "$1" in
@@ -33,7 +33,7 @@ do
-A) all_into_one=t
unpack_unreachable=--unpack-unreachable ;;
-d) remove_redundant=t ;;
- -q) quiet=-q ;;
+ -q) GIT_QUIET=-q ;;
-f) no_reuse=--no-reuse-object ;;
-l) local=--local ;;
--max-pack-size|--window|--window-memory|--depth)
@@ -80,13 +80,11 @@ case ",$all_into_one," in
;;
esac
-args="$args $local $quiet $no_reuse$extra"
+args="$args $local $GIT_QUIET $no_reuse$extra"
names=$(git pack-objects --honor-pack-keep --non-empty --all --reflog $args </dev/null "$PACKTMP") ||
exit 1
if [ -z "$names" ]; then
- if test -z "$quiet"; then
- echo Nothing new to pack.
- fi
+ say Nothing new to pack.
fi
# Ok we have prepared all new packfiles.
@@ -176,7 +174,7 @@ then
done
)
fi
- git prune-packed $quiet
+ git prune-packed $GIT_QUIET
fi
case "$no_update_info" in
diff --git a/git-submodule.sh b/git-submodule.sh
index 19a3a84..58d2fd2 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -14,23 +14,11 @@ require_work_tree
command=
branch=
-quiet=
reference=
cached=
nofetch=
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 ()
{
@@ -137,7 +125,7 @@ cmd_add()
shift
;;
-q|--quiet)
- quiet=1
+ GIT_QUIET=1
;;
--reference)
case "$2" in '') usage ;; esac
@@ -273,7 +261,7 @@ cmd_init()
do
case "$1" in
-q|--quiet)
- quiet=1
+ GIT_QUIET=1
;;
--)
shift
@@ -333,7 +321,7 @@ cmd_update()
case "$1" in
-q|--quiet)
shift
- quiet=1
+ GIT_QUIET=1
;;
-i|--init)
init=1
@@ -650,7 +638,7 @@ cmd_status()
do
case "$1" in
-q|--quiet)
- quiet=1
+ GIT_QUIET=1
;;
--cached)
cached=1
@@ -704,7 +692,7 @@ cmd_sync()
do
case "$1" in
-q|--quiet)
- quiet=1
+ GIT_QUIET=1
shift
;;
--)
@@ -759,7 +747,7 @@ do
command=$1
;;
-q|--quiet)
- quiet=1
+ GIT_QUIET=1
;;
-b|--branch)
case "$2" in
--
1.6.3.2.306.g4f4fa
next prev parent reply other threads:[~2009-06-16 2:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-16 2:05 [PATCHv3 0/4] Teach shell scripts to be quiet Stephen Boyd
2009-06-16 2:05 ` [PATCHv3 1/4] t4150: test applying with a newline in subject Stephen Boyd
2009-06-16 2:05 ` [PATCHv3 2/4] git-sh-setup: introduce say() for quiet options Stephen Boyd
2009-06-16 2:05 ` Stephen Boyd [this message]
2009-06-16 2:05 ` [PATCHv3 4/4] am, rebase: teach quiet option Stephen Boyd
2009-06-16 5:57 ` Junio C Hamano
2009-06-16 7:50 ` Stephen Boyd
2009-06-16 5:56 ` [PATCHv3 3/4] submodule, repack: migrate to git-sh-setup's say() Junio C Hamano
2009-06-16 6:18 ` Junio C Hamano
2009-06-16 7:38 ` Stephen Boyd
2009-06-16 8:13 ` [PATCHv3 2/4] git-sh-setup: introduce say() for quiet options Johannes Sixt
2009-06-16 22:32 ` [PATCHv4 0/5] Teach shell scripts to be quiet Stephen Boyd
2009-06-16 22:32 ` [PATCHv4 1/5] t4150: test applying with a newline in subject Stephen Boyd
2009-06-16 22:32 ` [PATCHv4 2/5] am: suppress apply errors when using 3-way Stephen Boyd
2009-06-16 22:32 ` [PATCHv4 3/5] git-sh-setup: introduce say() for quiet options Stephen Boyd
2009-06-16 22:33 ` [PATCHv4 4/5] submodule, repack: migrate to git-sh-setup's say() Stephen Boyd
2009-06-16 22:33 ` [PATCHv4 5/5] am, rebase: teach quiet option Stephen Boyd
2009-06-18 1:07 ` [PATCHv4 6/5] stash: " Stephen Boyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1245117905-19351-4-git-send-email-bebarino@gmail.com \
--to=bebarino@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.net \
--cc=thomas.adam22@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).