From: Orgad Shaneh Date: Wed, 10 Apr 2013 18:24:22 GMT Subject: [PATCH] submodule: add verbose mode for add/update Message-ID: <1365618262-8024-1-git-send-email-orgads@gmail.com> Executes checkout without -q --- git-submodule.sh | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index 79bfaac..f7964ad 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -5,11 +5,11 @@ # Copyright (c) 2007 Lars Hjemli dashless=$(basename "$0" | sed -e 's/-/ /') -USAGE="[--quiet] add [-b ] [-f|--force] [--name ] [--reference ] [--] [] +USAGE="[--quiet] add [-b ] [-f|--force] [--name ] [--reference ] [-v|--verbose] [--] [] or: $dashless [--quiet] status [--cached] [--recursive] [--] [...] or: $dashless [--quiet] init [--] [...] or: $dashless [--quiet] deinit [-f|--force] [--] ... - or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--rebase] [--reference ] [--merge] [--recursive] [--] [...] + or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--rebase] [--reference ] [--merge] [--recursive] [-v|--verbose] [--] [...] or: $dashless [--quiet] summary [--cached|--files] [--summary-limit ] [commit] [--] [...] or: $dashless [--quiet] foreach [--recursive] or: $dashless [--quiet] sync [--recursive] [--] [...]" @@ -309,6 +309,9 @@ cmd_add() custom_name=$2 shift ;; + -v|--verbose) + VERBOSE=1 + ;; --) shift break @@ -408,11 +411,15 @@ Use -f if you really want to add it." >&2 module_clone "$sm_path" "$sm_name" "$realrepo" "$reference" || exit ( clear_local_git_env + if test -z "$VERBOSE" + then + subquiet=-q + fi cd "$sm_path" && # ash fails to wordsplit ${branch:+-b "$branch"...} case "$branch" in - '') git checkout -f -q ;; - ?*) git checkout -f -q -B "$branch" "origin/$branch" ;; + '') git checkout -f $subquiet ;; + ?*) git checkout -f $subquiet -B "$branch" "origin/$branch" ;; esac ) || die "$(eval_gettext "Unable to checkout submodule '\$sm_path'")" fi @@ -676,6 +683,9 @@ cmd_update() --checkout) update="checkout" ;; + -v|--verbose) + VERBOSE=1 + ;; --) shift break @@ -799,7 +809,11 @@ Maybe you want to use 'update --init'?")" must_die_on_failure=yes ;; *) - command="git checkout $subforce -q" + if test -z "$VERBOSE" + then + subquiet=-q + fi + command="git checkout $subforce $subquiet" die_msg="$(eval_gettext "Unable to checkout '\$sha1' in submodule path '\$prefix\$sm_path'")" say_msg="$(eval_gettext "Submodule path '\$prefix\$sm_path': checked out '\$sha1'")" ;; -- 1.7.10.4