{"thread":{"id":"33462","subject":"[PATCH] submodule: add verbose mode for add/update","startedAt":"2013-04-10T18:24:22Z","lastAt":"2013-04-10T20:13:38Z","messageCount":3,"participants":["Orgad Shaneh","Jens Lehmann"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"213797","messageId":"1365618262-8024-1-git-send-email-orgads@gmail.com","threadId":"33462","inReplyTo":null,"subject":"[PATCH] submodule: add verbose mode for add/update","fromName":"Orgad Shaneh","fromEmail":"orgads@gmail.com","sentAt":"2013-04-10T18:24:22Z","receivedAt":"2013-04-10T18:24:22Z","isPatch":true,"sender":{"key":"orgads@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1246544?v=4"},"body":"Executes checkout without -q\n---\n git-submodule.sh |   24 +++++++++++++++++++-----\n 1 file changed, 19 insertions(+), 5 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 79bfaac..f7964ad 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -5,11 +5,11 @@\n # Copyright (c) 2007 Lars Hjemli\n \n dashless=$(basename \"$0\" | sed -e 's/-/ /')\n-USAGE=\"[--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]\n+USAGE=\"[--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [-v|--verbose] [--] <repository> [<path>]\n    or: $dashless [--quiet] status [--cached] [--recursive] [--] [<path>...]\n    or: $dashless [--quiet] init [--] [<path>...]\n    or: $dashless [--quiet] deinit [-f|--force] [--] <path>...\n-   or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--rebase] [--reference <repository>] [--merge] [--recursive] [--] [<path>...]\n+   or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--rebase] [--reference <repository>] [--merge] [--recursive] [-v|--verbose] [--] [<path>...]\n    or: $dashless [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]\n    or: $dashless [--quiet] foreach [--recursive] <command>\n    or: $dashless [--quiet] sync [--recursive] [--] [<path>...]\"\n@@ -309,6 +309,9 @@ cmd_add()\n \t\t\tcustom_name=$2\n \t\t\tshift\n \t\t\t;;\n+\t\t-v|--verbose)\n+\t\t\tVERBOSE=1\n+\t\t\t;;\n \t\t--)\n \t\t\tshift\n \t\t\tbreak\n@@ -408,11 +411,15 @@ Use -f if you really want to add it.\" >&2\n \t\tmodule_clone \"$sm_path\" \"$sm_name\" \"$realrepo\" \"$reference\" || exit\n \t\t(\n \t\t\tclear_local_git_env\n+\t\t\tif test -z \"$VERBOSE\"\n+\t\t\tthen\n+\t\t\t\tsubquiet=-q\n+\t\t\tfi\n \t\t\tcd \"$sm_path\" &&\n \t\t\t# ash fails to wordsplit ${branch:+-b \"$branch\"...}\n \t\t\tcase \"$branch\" in\n-\t\t\t'') git checkout -f -q ;;\n-\t\t\t?*) git checkout -f -q -B \"$branch\" \"origin/$branch\" ;;\n+\t\t\t'') git checkout -f $subquiet ;;\n+\t\t\t?*) git checkout -f $subquiet -B \"$branch\" \"origin/$branch\" ;;\n \t\t\tesac\n \t\t) || die \"$(eval_gettext \"Unable to checkout submodule '\\$sm_path'\")\"\n \tfi\n@@ -676,6 +683,9 @@ cmd_update()\n \t\t--checkout)\n \t\t\tupdate=\"checkout\"\n \t\t\t;;\n+\t\t-v|--verbose)\n+\t\t\tVERBOSE=1\n+\t\t\t;;\n \t\t--)\n \t\t\tshift\n \t\t\tbreak\n@@ -799,7 +809,11 @@ Maybe you want to use 'update --init'?\")\"\n \t\t\t\tmust_die_on_failure=yes\n \t\t\t\t;;\n \t\t\t*)\n-\t\t\t\tcommand=\"git checkout $subforce -q\"\n+\t\t\t\tif test -z \"$VERBOSE\"\n+\t\t\t\tthen\n+\t\t\t\t\tsubquiet=-q\n+\t\t\t\tfi\n+\t\t\t\tcommand=\"git checkout $subforce $subquiet\"\n \t\t\t\tdie_msg=\"$(eval_gettext \"Unable to checkout '\\$sha1' in submodule path '\\$prefix\\$sm_path'\")\"\n \t\t\t\tsay_msg=\"$(eval_gettext \"Submodule path '\\$prefix\\$sm_path': checked out '\\$sha1'\")\"\n \t\t\t\t;;\n-- \n1.7.10.4\n"},{"id":"213824","messageId":"5165C4EA.60308@web.de","threadId":"33462","inReplyTo":"1365618262-8024-1-git-send-email-orgads@gmail.com","subject":"Re: [PATCH] submodule: add verbose mode for add/update","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2013-04-10T20:00:42Z","receivedAt":"2013-04-10T20:00:42Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 10.04.2013 20:24, schrieb Orgad Shaneh:\n> Executes checkout without -q\n\nNice, looks like you picked the proposal I made last September:\n  http://permalink.gmane.org/gmane.comp.version-control.git/204747\n\nThe change is looking good, but you still need to document the\nnew option in Documentation/git-submodule.txt too please.\n\nAnd the commit message is still too short, as I said in that\nother thread:\n\nOn Tue, Sep 4, 2012 at 6:28 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n> Before the \"Signed-off-by\" is the place where you should have\n> explained why this would be a worthwhile change ;-)\n\nAnd you answered to that with something that would really make\nsense as first part of the commit message, because you explain\n*why* you do that change:\n\nAm 05.09.2012 13:42, schrieb Orgad and Raizel Shaneh:\n> When I run 'git submodule update' I don't expect to be in the dark\n> until the submodule/s finishes checkout, this sometimes can take a\n> significant amount of time and feedback is expected.\n\nAnother paragraph after that should explain *how* you do it.\n\nSo what about the following as commit message:\n--------------------------------------------------------------\nWhen 'git submodule add/update' is run there is no output during\ncheckout. This can take a significant amount of time and it would\nbe nice if user could enable some feedback to see what's going on.\n\nAdd the -v/--verbose option to both add and update which suppresses\nthe -q normally given to checkout so the user sees progress output\nfrom the checkout command.\n\n<Your Signed-off-by goes here>\n--------------------------------------------------------------\n\nI'm looking forward to your next iteration.\n\n> ---\n>  git-submodule.sh |   24 +++++++++++++++++++-----\n>  1 file changed, 19 insertions(+), 5 deletions(-)\n> \n> diff --git a/git-submodule.sh b/git-submodule.sh\n> index 79bfaac..f7964ad 100755\n> --- a/git-submodule.sh\n> +++ b/git-submodule.sh\n> @@ -5,11 +5,11 @@\n>  # Copyright (c) 2007 Lars Hjemli\n>  \n>  dashless=$(basename \"$0\" | sed -e 's/-/ /')\n> -USAGE=\"[--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]\n> +USAGE=\"[--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [-v|--verbose] [--] <repository> [<path>]\n>     or: $dashless [--quiet] status [--cached] [--recursive] [--] [<path>...]\n>     or: $dashless [--quiet] init [--] [<path>...]\n>     or: $dashless [--quiet] deinit [-f|--force] [--] <path>...\n> -   or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--rebase] [--reference <repository>] [--merge] [--recursive] [--] [<path>...]\n> +   or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--rebase] [--reference <repository>] [--merge] [--recursive] [-v|--verbose] [--] [<path>...]\n>     or: $dashless [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]\n>     or: $dashless [--quiet] foreach [--recursive] <command>\n>     or: $dashless [--quiet] sync [--recursive] [--] [<path>...]\"\n> @@ -309,6 +309,9 @@ cmd_add()\n>  \t\t\tcustom_name=$2\n>  \t\t\tshift\n>  \t\t\t;;\n> +\t\t-v|--verbose)\n> +\t\t\tVERBOSE=1\n> +\t\t\t;;\n>  \t\t--)\n>  \t\t\tshift\n>  \t\t\tbreak\n> @@ -408,11 +411,15 @@ Use -f if you really want to add it.\" >&2\n>  \t\tmodule_clone \"$sm_path\" \"$sm_name\" \"$realrepo\" \"$reference\" || exit\n>  \t\t(\n>  \t\t\tclear_local_git_env\n> +\t\t\tif test -z \"$VERBOSE\"\n> +\t\t\tthen\n> +\t\t\t\tsubquiet=-q\n> +\t\t\tfi\n>  \t\t\tcd \"$sm_path\" &&\n>  \t\t\t# ash fails to wordsplit ${branch:+-b \"$branch\"...}\n>  \t\t\tcase \"$branch\" in\n> -\t\t\t'') git checkout -f -q ;;\n> -\t\t\t?*) git checkout -f -q -B \"$branch\" \"origin/$branch\" ;;\n> +\t\t\t'') git checkout -f $subquiet ;;\n> +\t\t\t?*) git checkout -f $subquiet -B \"$branch\" \"origin/$branch\" ;;\n>  \t\t\tesac\n>  \t\t) || die \"$(eval_gettext \"Unable to checkout submodule '\\$sm_path'\")\"\n>  \tfi\n> @@ -676,6 +683,9 @@ cmd_update()\n>  \t\t--checkout)\n>  \t\t\tupdate=\"checkout\"\n>  \t\t\t;;\n> +\t\t-v|--verbose)\n> +\t\t\tVERBOSE=1\n> +\t\t\t;;\n>  \t\t--)\n>  \t\t\tshift\n>  \t\t\tbreak\n> @@ -799,7 +809,11 @@ Maybe you want to use 'update --init'?\")\"\n>  \t\t\t\tmust_die_on_failure=yes\n>  \t\t\t\t;;\n>  \t\t\t*)\n> -\t\t\t\tcommand=\"git checkout $subforce -q\"\n> +\t\t\t\tif test -z \"$VERBOSE\"\n> +\t\t\t\tthen\n> +\t\t\t\t\tsubquiet=-q\n> +\t\t\t\tfi\n> +\t\t\t\tcommand=\"git checkout $subforce $subquiet\"\n>  \t\t\t\tdie_msg=\"$(eval_gettext \"Unable to checkout '\\$sha1' in submodule path '\\$prefix\\$sm_path'\")\"\n>  \t\t\t\tsay_msg=\"$(eval_gettext \"Submodule path '\\$prefix\\$sm_path': checked out '\\$sha1'\")\"\n>  \t\t\t\t;;\n> \n"},{"id":"213831","messageId":"CAGHpTBKn-2dgDwTFtw9eLuJAgFidzEa2itjE+Jc=VrQ0z+-oNA@mail.gmail.com","threadId":"33462","inReplyTo":"CAGHpTBK6qGUcj=ioWCN2Y5bkhNg8t0ik0BNfXNLww0zjm+1xGQ@mail.gmail.com","subject":"Fwd: [PATCH] submodule: add verbose mode for add/update","fromName":"Orgad Shaneh","fromEmail":"orgads@gmail.com","sentAt":"2013-04-10T20:13:38Z","receivedAt":"2013-04-10T20:13:38Z","isPatch":true,"sender":{"key":"orgads@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1246544?v=4"},"body":"On Wed, Apr 10, 2013 at 11:00 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n>\n> Am 10.04.2013 20:24, schrieb Orgad Shaneh:\n> > Executes checkout without -q\n>\n> Nice, looks like you picked the proposal I made last September:\n>   http://permalink.gmane.org/gmane.comp.version-control.git/204747\n\nTook me a while, but I finally got to it :)\n\n> The change is looking good, but you still need to document the\n> new option in Documentation/git-submodule.txt too please.\n>\n> And the commit message is still too short, as I said in that\n> other thread:\n>\n> On Tue, Sep 4, 2012 at 6:28 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n> > Before the \"Signed-off-by\" is the place where you should have\n> > explained why this would be a worthwhile change ;-)\n>\n> And you answered to that with something that would really make\n> sense as first part of the commit message, because you explain\n> *why* you do that change:\n>\n> Am 05.09.2012 13:42, schrieb Orgad and Raizel Shaneh:\n> > When I run 'git submodule update' I don't expect to be in the dark\n> > until the submodule/s finishes checkout, this sometimes can take a\n> > significant amount of time and feedback is expected.\n>\n> Another paragraph after that should explain *how* you do it.\n>\n> So what about the following as commit message:\n> --------------------------------------------------------------\n> When 'git submodule add/update' is run there is no output during\n> checkout. This can take a significant amount of time and it would\n> be nice if user could enable some feedback to see what's going on.\n>\n> Add the -v/--verbose option to both add and update which suppresses\n> the -q normally given to checkout so the user sees progress output\n> from the checkout command.\n>\n> <Your Signed-off-by goes here>\n> --------------------------------------------------------------\n>\n> I'm looking forward to your next iteration.\n\nDone quicker this time ;-)\n\nThanks a lot for your review (previous and current). It was very helpful!\n\n- Orgad\n"}]}