git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] submodule: add verbose mode for add/update
@ 2013-04-10 18:24 Orgad Shaneh
  2013-04-10 20:00 ` Jens Lehmann
  0 siblings, 1 reply; 11+ messages in thread
From: Orgad Shaneh @ 2013-04-10 18:24 UTC (permalink / raw)
  To: git; +Cc: Orgad Shaneh

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 <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'")"
 				;;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [PATCH] submodule: add verbose mode for add/update
@ 2013-04-10 20:10 Orgad Shaneh
  0 siblings, 0 replies; 11+ messages in thread
From: Orgad Shaneh @ 2013-04-10 20:10 UTC (permalink / raw)
  To: git; +Cc: Orgad Shaneh

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.

Signed-off-by: Orgad Shaneh <orgads@gmail.com>
---
 Documentation/git-submodule.txt |   10 ++++++++--
 git-submodule.sh                |   24 +++++++++++++++++++-----
 2 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
index 74d5bdc..6abfd5d 100644
--- a/Documentation/git-submodule.txt
+++ b/Documentation/git-submodule.txt
@@ -10,13 +10,13 @@ SYNOPSIS
 --------
 [verse]
 'git submodule' [--quiet] add [-b <branch>] [-f|--force] [--name <name>]
-	      [--reference <repository>] [--] <repository> [<path>]
+	      [--reference <repository>] [-v|--verbose] [--] <repository> [<path>]
 'git submodule' [--quiet] status [--cached] [--recursive] [--] [<path>...]
 'git submodule' [--quiet] init [--] [<path>...]
 'git submodule' [--quiet] deinit [-f|--force] [--] <path>...
 'git submodule' [--quiet] update [--init] [--remote] [-N|--no-fetch]
 	      [-f|--force] [--rebase] [--reference <repository>]
-	      [--merge] [--recursive] [--] [<path>...]
+	      [--merge] [--recursive] [-v|--verbose] [--] [<path>...]
 'git submodule' [--quiet] summary [--cached|--files] [(-n|--summary-limit) <n>]
 	      [commit] [--] [<path>...]
 'git submodule' [--quiet] foreach [--recursive] <command>
@@ -324,6 +324,12 @@ for linkgit:git-clone[1]'s `--reference` and `--shared` options carefully.
 	only in the submodules of the current repo, but also
 	in any nested submodules inside those submodules (and so on).
 
+-v::
+--verbose::
+	This option makes the checkout operation more verbose.
+	By default, a quiet checkout is performed. Specifying --verbose
+	provides progress information to the user.
+
 <path>...::
 	Paths to submodule(s). When specified this will restrict the command
 	to only operate on the submodules found at the specified paths.
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'")"
 				;;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [PATCH] submodule: add verbose mode for add/update
@ 2014-03-12  6:38 Orgad Shaneh
  2014-03-12  8:35 ` Eric Sunshine
  0 siblings, 1 reply; 11+ messages in thread
From: Orgad Shaneh @ 2014-03-12  6:38 UTC (permalink / raw)
  To: git

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 a33f68d..5c4e057 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>...]"
@@ -319,12 +319,16 @@ module_clone()
  rel=$(echo $a | sed -e 's|[^/][^/]*|..|g')
  (
  clear_local_git_env
+ if test -z "$verbose"
+ then
+ subquiet=-q
+ fi
  cd "$sm_path" &&
  GIT_WORK_TREE=. git config core.worktree "$rel/$b" &&
  # ash fails to wordsplit ${local_branch:+-B "$local_branch"...}
  case "$local_branch" in
- '') git checkout -f -q ${start_point:+"$start_point"} ;;
- ?*) git checkout -f -q -B "$local_branch" ${start_point:+"$start_point"} ;;
+ '') git checkout -f $subquiet ${start_point:+"$start_point"} ;;
+ ?*) git checkout -f $subquiet -B "$local_branch"
${start_point:+"$start_point"} ;;
  esac
  ) || die "$(eval_gettext "Unable to setup cloned submodule '\$sm_path'")"
 }
@@ -380,6 +384,9 @@ cmd_add()
  --depth=*)
  depth=$1
  ;;
+ -v|--verbose)
+ verbose=1
+ ;;
  --)
  shift
  break
@@ -786,6 +793,9 @@ cmd_update()
  --depth=*)
  depth=$1
  ;;
+ -v|--verbose)
+ verbose=1
+ ;;
  --)
  shift
  break
@@ -913,7 +923,11 @@ Maybe you want to use 'update --init'?")"
  must_die_on_failure=
  case "$update_module" in
  checkout)
- 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 '\$displaypath'")"
  say_msg="$(eval_gettext "Submodule path '\$displaypath': checked out
'\$sha1'")"
  ;;
-- 
1.9.0.msysgit.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [PATCH] submodule: add verbose mode for add/update
@ 2014-03-12 13:42 Orgad Shaneh
  2014-03-12 16:15 ` Jens Lehmann
  0 siblings, 1 reply; 11+ messages in thread
From: Orgad Shaneh @ 2014-03-12 13:42 UTC (permalink / raw)
  To: git; +Cc: Orgad Shaneh

From: Orgad Shaneh <orgads@gmail.com>

Executes checkout without -q

Signed-off-by: Orgad Shaneh <orgads@gmail.com>
---
 Documentation/git-submodule.txt |  7 +++++--
 git-submodule.sh                | 24 +++++++++++++++++++-----
 t/t7406-submodule-update.sh     |  9 +++++++++
 3 files changed, 33 insertions(+), 7 deletions(-)

diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
index 21cb59a..1867e94 100644
--- a/Documentation/git-submodule.txt
+++ b/Documentation/git-submodule.txt
@@ -10,13 +10,13 @@ SYNOPSIS
 --------
 [verse]
 'git submodule' [--quiet] add [-b <branch>] [-f|--force] [--name <name>]
-	      [--reference <repository>] [--depth <depth>] [--] <repository> [<path>]
+	      [--reference <repository>] [--depth <depth>] [-v|--verbose] [--] <repository> [<path>]
 'git submodule' [--quiet] status [--cached] [--recursive] [--] [<path>...]
 'git submodule' [--quiet] init [--] [<path>...]
 'git submodule' [--quiet] deinit [-f|--force] [--] <path>...
 'git submodule' [--quiet] update [--init] [--remote] [-N|--no-fetch]
 	      [-f|--force] [--rebase|--merge|--checkout] [--reference <repository>]
-	      [--depth <depth>] [--recursive] [--] [<path>...]
+	      [--depth <depth>] [--recursive] [-v|--verbose] [--] [<path>...]
 'git submodule' [--quiet] summary [--cached|--files] [(-n|--summary-limit) <n>]
 	      [commit] [--] [<path>...]
 'git submodule' [--quiet] foreach [--recursive] <command>
@@ -363,6 +363,9 @@ for linkgit:git-clone[1]'s `--reference` and `--shared` options carefully.
 	clone with a history truncated to the specified number of revisions.
 	See linkgit:git-clone[1]
 
+--verbose::
+  This option is valid for add and update commands. Show output of
+  checkout.
 
 <path>...::
 	Paths to submodule(s). When specified this will restrict the command
diff --git a/git-submodule.sh b/git-submodule.sh
index a33f68d..5c4e057 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>...]"
@@ -319,12 +319,16 @@ module_clone()
 	rel=$(echo $a | sed -e 's|[^/][^/]*|..|g')
 	(
 		clear_local_git_env
+		if test -z "$verbose"
+		then
+			subquiet=-q
+		fi
 		cd "$sm_path" &&
 		GIT_WORK_TREE=. git config core.worktree "$rel/$b" &&
 		# ash fails to wordsplit ${local_branch:+-B "$local_branch"...}
 		case "$local_branch" in
-		'') git checkout -f -q ${start_point:+"$start_point"} ;;
-		?*) git checkout -f -q -B "$local_branch" ${start_point:+"$start_point"} ;;
+		'') git checkout -f $subquiet ${start_point:+"$start_point"} ;;
+		?*) git checkout -f $subquiet -B "$local_branch" ${start_point:+"$start_point"} ;;
 		esac
 	) || die "$(eval_gettext "Unable to setup cloned submodule '\$sm_path'")"
 }
@@ -380,6 +384,9 @@ cmd_add()
 		--depth=*)
 			depth=$1
 			;;
+		-v|--verbose)
+			verbose=1
+			;;
 		--)
 			shift
 			break
@@ -786,6 +793,9 @@ cmd_update()
 		--depth=*)
 			depth=$1
 			;;
+		-v|--verbose)
+			verbose=1
+			;;
 		--)
 			shift
 			break
@@ -913,7 +923,11 @@ Maybe you want to use 'update --init'?")"
 			must_die_on_failure=
 			case "$update_module" in
 			checkout)
-				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 '\$displaypath'")"
 				say_msg="$(eval_gettext "Submodule path '\$displaypath': checked out '\$sha1'")"
 				;;
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index 28ca763..04a0fcc 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -83,6 +83,15 @@ test_expect_success 'submodule update detaching the HEAD ' '
 	)
 '
 
+test_expect_success 'submodule update verbose' '
+	(cd super/submodule &&
+	 git checkout master
+	) &&
+	(cd super &&
+	 git submodule update --verbose submodule 2>&1 | grep -q "HEAD is now at"
+	)
+'
+
 test_expect_success 'submodule update from subdirectory' '
 	(cd super/submodule &&
 	 git reset --hard HEAD~1
-- 
1.9.0.msysgit.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [PATCH] submodule: add verbose mode for add/update
@ 2014-03-12 20:03 Orgad Shaneh
  2014-03-12 20:19 ` Junio C Hamano
  0 siblings, 1 reply; 11+ messages in thread
From: Orgad Shaneh @ 2014-03-12 20:03 UTC (permalink / raw)
  To: git; +Cc: Orgad Shaneh

Add the verbose flag to add and update which displays the
progress of the actual submodule checkout when given. This
is useful for checkouts that take a long time, as the user
can then see the progress.

Signed-off-by: Orgad Shaneh <orgads@gmail.com>
---
 Documentation/git-submodule.txt |  7 +++++--
 git-submodule.sh                | 24 +++++++++++++++++++-----
 t/t7406-submodule-update.sh     | 10 ++++++++++
 3 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
index 21cb59a..0147b23 100644
--- a/Documentation/git-submodule.txt
+++ b/Documentation/git-submodule.txt
@@ -10,13 +10,13 @@ SYNOPSIS
 --------
 [verse]
 'git submodule' [--quiet] add [-b <branch>] [-f|--force] [--name <name>]
-	      [--reference <repository>] [--depth <depth>] [--] <repository> [<path>]
+	      [--reference <repository>] [--depth <depth>] [-v|--verbose] [--] <repository> [<path>]
 'git submodule' [--quiet] status [--cached] [--recursive] [--] [<path>...]
 'git submodule' [--quiet] init [--] [<path>...]
 'git submodule' [--quiet] deinit [-f|--force] [--] <path>...
 'git submodule' [--quiet] update [--init] [--remote] [-N|--no-fetch]
 	      [-f|--force] [--rebase|--merge|--checkout] [--reference <repository>]
-	      [--depth <depth>] [--recursive] [--] [<path>...]
+	      [--depth <depth>] [--recursive] [-v|--verbose] [--] [<path>...]
 'git submodule' [--quiet] summary [--cached|--files] [(-n|--summary-limit) <n>]
 	      [commit] [--] [<path>...]
 'git submodule' [--quiet] foreach [--recursive] <command>
@@ -363,6 +363,9 @@ for linkgit:git-clone[1]'s `--reference` and `--shared` options carefully.
 	clone with a history truncated to the specified number of revisions.
 	See linkgit:git-clone[1]
 
+--verbose::
+	This option is valid for add and update commands. Display the progress
+	of the actual submodule	checkout.
 
 <path>...::
 	Paths to submodule(s). When specified this will restrict the command
diff --git a/git-submodule.sh b/git-submodule.sh
index a33f68d..e1df2c8 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>...]"
@@ -319,12 +319,16 @@ module_clone()
 	rel=$(echo $a | sed -e 's|[^/][^/]*|..|g')
 	(
 		clear_local_git_env
+		if test -z "$verbose"
+		then
+			subquiet=-q
+		fi
 		cd "$sm_path" &&
 		GIT_WORK_TREE=. git config core.worktree "$rel/$b" &&
 		# ash fails to wordsplit ${local_branch:+-B "$local_branch"...}
 		case "$local_branch" in
-		'') git checkout -f -q ${start_point:+"$start_point"} ;;
-		?*) git checkout -f -q -B "$local_branch" ${start_point:+"$start_point"} ;;
+		'') git checkout -f ${subquiet:+"$subquiet"} ${start_point:+"$start_point"} ;;
+		?*) git checkout -f ${subquiet:+"$subquiet"} -B "$local_branch" ${start_point:+"$start_point"} ;;
 		esac
 	) || die "$(eval_gettext "Unable to setup cloned submodule '\$sm_path'")"
 }
@@ -380,6 +384,9 @@ cmd_add()
 		--depth=*)
 			depth=$1
 			;;
+		-v|--verbose)
+			verbose=1
+			;;
 		--)
 			shift
 			break
@@ -786,6 +793,9 @@ cmd_update()
 		--depth=*)
 			depth=$1
 			;;
+		-v|--verbose)
+			verbose=1
+			;;
 		--)
 			shift
 			break
@@ -913,7 +923,11 @@ Maybe you want to use 'update --init'?")"
 			must_die_on_failure=
 			case "$update_module" in
 			checkout)
-				command="git checkout $subforce -q"
+				if test -z "$verbose"
+				then
+					subquiet=-q
+				fi
+				command="git checkout $subforce ${subquiet:+"$subquiet"}"
 				die_msg="$(eval_gettext "Unable to checkout '\$sha1' in submodule path '\$displaypath'")"
 				say_msg="$(eval_gettext "Submodule path '\$displaypath': checked out '\$sha1'")"
 				;;
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index 28ca763..c3de90a 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -83,6 +83,16 @@ test_expect_success 'submodule update detaching the HEAD ' '
 	)
 '
 
+test_expect_success 'submodule update verbose' '
+	(cd super/submodule &&
+	 git checkout master
+	) &&
+	(cd super &&
+	 git submodule update --verbose submodule 2>messages &&
+	 test_i18ngrep "HEAD is now at" messages
+	)
+'
+
 test_expect_success 'submodule update from subdirectory' '
 	(cd super/submodule &&
 	 git reset --hard HEAD~1
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-03-12 20:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-10 18:24 [PATCH] submodule: add verbose mode for add/update Orgad Shaneh
2013-04-10 20:00 ` Jens Lehmann
     [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

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).