threads / patch / 46509

patchclone: teach recursive clones to respect -q

Subject: [PATCH] clone: teach recursive clones to respect -q

## tl;dr

4 messages between Aug 3, 2017 and Aug 4, 2017. Diffs are folded; open one to read it.

replies: 3people: 3as markdown or json

Brandon Williams· Aug 3, 2017, 22:25 UTC · lore

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

Signed-off-by: Brandon Williams <bmwill@google.com>
---
 builtin/clone.c            | 3 +++
 t/t7400-submodule-basic.sh | 6 ++++++
 2 files changed, 9 insertions(+)
Show changes to 2 files +9 −0

builtin/clone.c, t/t7400-submodule-basic.sh

diff --git a/builtin/clone.c b/builtin/clone.c
index 08b5cc433..f7e17d229 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -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);
 	}
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index dcac364c5..e9c3335b7 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -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
-- 
2.14.0.rc1.383.gd1ce394fe2-goog
Stefan Beller· Aug 3, 2017, 22:32 UTC · re: Brandon Williams · lore

Re: [PATCH] clone: teach recursive clones to respect -q

On Thu, Aug 3, 2017 at 3:25 PM, Brandon Williams <bmwill@google.com> wrote:
Show 6 quoted lines
> Teach 'git clone --recurse-submodules' to respect the '-q' option by
> passing down the quiet flag to the process which handles cloning of
> submodules.
>
> Signed-off-by: Brandon Williams <bmwill@google.com>
> ---

Yay! Thanks for this. Looks good to me.

Junio C Hamano· Aug 4, 2017, 16:07 UTC · re: Brandon Williams · lore

Re: [PATCH] clone: teach recursive clones to respect -q

Brandon Williams <bmwill@google.com> writes:
Show 24 quoted lines
> Teach 'git clone --recurse-submodules' to respect the '-q' option by
> passing down the quiet flag to the process which handles cloning of
> submodules.
>
> Signed-off-by: Brandon Williams <bmwill@google.com>
> ---
>  builtin/clone.c            | 3 +++
>  t/t7400-submodule-basic.sh | 6 ++++++
>  2 files changed, 9 insertions(+)
>
> diff --git a/builtin/clone.c b/builtin/clone.c
> index 08b5cc433..f7e17d229 100644
> --- a/builtin/clone.c
> +++ b/builtin/clone.c
> @@ -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.
Show 15 quoted lines
> diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
> index dcac364c5..e9c3335b7 100755
> --- a/t/t7400-submodule-basic.sh
> +++ b/t/t7400-submodule-basic.sh
> @@ -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
Brandon Williams· Aug 4, 2017, 17:05 UTC · re: Junio C Hamano · lore

Re: [PATCH] clone: teach recursive clones to respect -q

On 08/04, Junio C Hamano wrote:
Show 30 quoted lines
> Brandon Williams <bmwill@google.com> writes:
> 
> > Teach 'git clone --recurse-submodules' to respect the '-q' option by
> > passing down the quiet flag to the process which handles cloning of
> > submodules.
> >
> > Signed-off-by: Brandon Williams <bmwill@google.com>
> > ---
> >  builtin/clone.c            | 3 +++
> >  t/t7400-submodule-basic.sh | 6 ++++++
> >  2 files changed, 9 insertions(+)
> >
> > diff --git a/builtin/clone.c b/builtin/clone.c
> > index 08b5cc433..f7e17d229 100644
> > --- a/builtin/clone.c
> > +++ b/builtin/clone.c
> > @@ -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 ;-)

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.

> 
> Will queue.  Thanks.
Thanks!
Show 16 quoted lines
> 
> > diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
> > index dcac364c5..e9c3335b7 100755
> > --- a/t/t7400-submodule-basic.sh
> > +++ b/t/t7400-submodule-basic.sh
> > @@ -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
-- 
Brandon Williams

← back to recent threads