Skip to contentSkip to conversation

clone: teach recursive clones to respect -q

PATCH In review Brandon Williams 3 participants 4 messages Aug 3, 2017 – Aug 4, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clone: teach recursive clones to respect -q

Teach 'git clone --recurse-submodules' to respect the '-q' option by passing down the quiet flag to the process which handles cloning of submodules.

---
 builtin/clone.c            | 3 +++
 t/t7400-submodule-basic.sh | 6 ++++++
 2 files changed, 9 insertions(+)
builtin/clone.c +3 -0
index 08b5cc433..f7e17d229 100644
@@ -768,6 +768,9 @@ static int checkout(int submodule_progress)
 		if (submodule_progress)
 			argv_array_push(&args, "--progress");
 
+		if (option_verbosity < 0)
+			argv_array_push(&args, "--quiet");
+
 		err = run_command_v_opt(args.argv, RUN_GIT_CMD);
 		argv_array_clear(&args);
 	}
t/t7400-submodule-basic.sh +6 -0
index dcac364c5..e9c3335b7 100755
@@ -1289,4 +1289,10 @@ test_expect_success 'init properly sets the config' '
 	test_must_fail git -C multisuper_clone config --get submodule.sub1.active
 '
 
+test_expect_success 'recursive clone respects -q' '
+	test_when_finished "rm -rf multisuper_clone" &&
+	git clone -q --recurse-submodules multisuper multisuper_clone >actual &&
+	test_must_be_empty actual
+'
+
 test_done
Signature · 1 line
2.14.0.rc1.383.gd1ce394fe2-goog
#1 lore raw
Quoted 6 lines · Brandon Williams

Teach 'git clone --recurse-submodules' to respect the '-q' option by passing down the quiet flag to the process which handles cloning of submodules.

---

Yay! Thanks for this.
Looks good to me.

#2 lore raw
In reply to Brandon Williams
Quoted 15 lines · Brandon Williams

Teach 'git clone --recurse-submodules' to respect the '-q' option by passing down the quiet flag to the process which handles cloning of submodules.

---
 builtin/clone.c            | 3 +++
 t/t7400-submodule-basic.sh | 6 ++++++
 2 files changed, 9 insertions(+)
builtin/clone.c +0 -0
index 08b5cc433..f7e17d229 100644

builtin/clone.c static int checkout(int submodule_progress) · line 776

Quoted 9 lines
builtin/clone.c +3 -0
@@ -768,6 +768,9 @@ static int checkout(int submodule_progress)
 		if (submodule_progress)
 			argv_array_push(&args, "--progress");
 
+		if (option_verbosity < 0)
+			argv_array_push(&args, "--quiet");
+
 		err = run_command_v_opt(args.argv, RUN_GIT_CMD);
 		argv_array_clear(&args);
 	}

Good spotting. Makes me wonder if there still are other options we might have missed, but we can incrementally improve as bug report comes in ;-)

Will queue. Thanks.

Quoted 15 lines
t/t7400-submodule-basic.sh +6 -0
index dcac364c5..e9c3335b7 100755
@@ -1289,4 +1289,10 @@ test_expect_success 'init properly sets the config' '
 	test_must_fail git -C multisuper_clone config --get submodule.sub1.active
 '
 
+test_expect_success 'recursive clone respects -q' '
+	test_when_finished "rm -rf multisuper_clone" &&
+	git clone -q --recurse-submodules multisuper multisuper_clone >actual &&
+	test_must_be_empty actual
+'
+
 test_done
#3 lore raw
Quoted 20 lines · Junio C Hamano
Quoted 18 lines · Brandon Williams

Teach 'git clone --recurse-submodules' to respect the '-q' option by passing down the quiet flag to the process which handles cloning of submodules.

---
 builtin/clone.c            | 3 +++
 t/t7400-submodule-basic.sh | 6 ++++++
 2 files changed, 9 insertions(+)
builtin/clone.c +0 -0
index 08b5cc433..f7e17d229 100644
@@ -768,6 +768,9 @@ static int checkout(int submodule_progress)
 		if (submodule_progress)
 			argv_array_push(&args, "--progress");
 
Quoted 10 lines

builtin/clone.c static int checkout(int submodule_progress) · line 776

Quoted 6 lines
builtin/clone.c +3 -0
+		if (option_verbosity < 0)
+			argv_array_push(&args, "--quiet");
+
 		err = run_command_v_opt(args.argv, RUN_GIT_CMD);
 		argv_array_clear(&args);
 	}

Good spotting. Makes me wonder if there still are other options we might have missed, but we can incrementally improve as bug report comes in ;-)

Yeah I've noticed that the number one difficulty with doing submodule operations in another process is making sure that the correct options are passed down.

Quoted 2 lines

Will queue. Thanks.

Thanks!

Quoted 16 lines
Quoted 16 lines
t/t7400-submodule-basic.sh +6 -0
index dcac364c5..e9c3335b7 100755
@@ -1289,4 +1289,10 @@ test_expect_success 'init properly sets the config' '
 	test_must_fail git -C multisuper_clone config --get submodule.sub1.active
 '
 
+test_expect_success 'recursive clone respects -q' '
+	test_when_finished "rm -rf multisuper_clone" &&
+	git clone -q --recurse-submodules multisuper multisuper_clone >actual &&
+	test_must_be_empty actual
+'
+
 test_done
Signature · 1 line
Brandon Williams