git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jens Lehmann <Jens.Lehmann@web.de>
To: Orgad Shaneh <orgads@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] submodule: add verbose mode for add/update
Date: Wed, 10 Apr 2013 22:00:42 +0200	[thread overview]
Message-ID: <5165C4EA.60308@web.de> (raw)
In-Reply-To: <1365618262-8024-1-git-send-email-orgads@gmail.com>

Am 10.04.2013 20:24, schrieb Orgad Shaneh:
> Executes checkout without -q

Nice, looks like you picked the proposal I made last September:
  http://permalink.gmane.org/gmane.comp.version-control.git/204747

The change is looking good, but you still need to document the
new option in Documentation/git-submodule.txt too please.

And the commit message is still too short, as I said in that
other thread:

On Tue, Sep 4, 2012 at 6:28 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:
> Before the "Signed-off-by" is the place where you should have
> explained why this would be a worthwhile change ;-)

And you answered to that with something that would really make
sense as first part of the commit message, because you explain
*why* you do that change:

Am 05.09.2012 13:42, schrieb Orgad and Raizel Shaneh:
> When I run 'git submodule update' I don't expect to be in the dark
> until the submodule/s finishes checkout, this sometimes can take a
> significant amount of time and feedback is expected.

Another paragraph after that should explain *how* you do it.

So what about the following as commit message:
--------------------------------------------------------------
When 'git submodule add/update' is run there is no output during
checkout. This can take a significant amount of time and it would
be nice if user could enable some feedback to see what's going on.

Add the -v/--verbose option to both add and update which suppresses
the -q normally given to checkout so the user sees progress output
from the checkout command.

<Your Signed-off-by goes here>
--------------------------------------------------------------

I'm looking forward to your next iteration.

> ---
>  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 <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]
> +USAGE="[--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [-v|--verbose] [--] <repository> [<path>]
>     or: $dashless [--quiet] status [--cached] [--recursive] [--] [<path>...]
>     or: $dashless [--quiet] init [--] [<path>...]
>     or: $dashless [--quiet] deinit [-f|--force] [--] <path>...
> -   or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--rebase] [--reference <repository>] [--merge] [--recursive] [--] [<path>...]
> +   or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--rebase] [--reference <repository>] [--merge] [--recursive] [-v|--verbose] [--] [<path>...]
>     or: $dashless [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
>     or: $dashless [--quiet] foreach [--recursive] <command>
>     or: $dashless [--quiet] sync [--recursive] [--] [<path>...]"
> @@ -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'")"
>  				;;
> 

  reply	other threads:[~2013-04-10 20:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10 18:24 [PATCH] submodule: add verbose mode for add/update Orgad Shaneh
2013-04-10 20:00 ` Jens Lehmann [this message]
     [not found]   ` <CAGHpTBK6qGUcj=ioWCN2Y5bkhNg8t0ik0BNfXNLww0zjm+1xGQ@mail.gmail.com>
2013-04-10 20:13     ` Fwd: " Orgad Shaneh
  -- strict thread matches above, loose matches on Subject: below --
2013-04-10 20:10 Orgad Shaneh
2014-03-12  6:38 Orgad Shaneh
2014-03-12  8:35 ` Eric Sunshine
2014-03-12 13:42 Orgad Shaneh
2014-03-12 16:15 ` Jens Lehmann
2014-03-12 20:00   ` Orgad Shaneh
2014-03-12 20:03 Orgad Shaneh
2014-03-12 20:19 ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5165C4EA.60308@web.de \
    --to=jens.lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=orgads@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).