git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] pull: Apply -q and -v options to rebase mode as well

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 17, 2013, 04:53 UTC
Message-ID
<7vip4qtymy.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1363314368.14066.3.camel@vanquo.pezone.net>
Peter Eisentraut <peter@eisentraut.org> writes:
Show 6 quoted lines
> git pull passed -q and -v only to git merge, but they can be useful for
> git rebase as well, so pass them there, too.  In particular, using -q
> shuts up the "Already up-to-date." message.  Add test cases to prove it.
>
> Signed-off-by: Peter Eisentraut <peter@eisentraut.org>
> ---
Looks quite straight-forward.

I wouldn't call our test cases "proving" anything, though. The reason we add tests is to make sure that others who touch the code later will not break the feature you add today by documenting the behaviour we expect out of our code.

Show 18 quoted lines
> diff --git a/t/t5521-pull-options.sh b/t/t5521-pull-options.sh
> index 1b06691..aa31abe 100755
> --- a/t/t5521-pull-options.sh
> +++ b/t/t5521-pull-options.sh
> @@ -19,6 +19,17 @@ test_expect_success 'git pull -q' '
>  	test ! -s out)
>  '
>  
> +test_expect_success 'git pull -q --rebase' '
> +	mkdir clonedqrb &&
> +	(cd clonedqrb && git init &&
> +	git pull -q --rebase "../parent" >out 2>err &&
> +	test ! -s err &&
> +	test ! -s out &&
> +	git pull -q --rebase "../parent" >out 2>err &&
> +	test ! -s err &&
> +	test ! -s out)
> +'

Pulling twice is a good thing here, to see how it behaves when there is something to be fetched, and when you are up to date. I think it is a good idea to add it to the normal 'pull -q' test.

Thanks.
Previous: Peter Eisentraut
Message 2 of 2 in “pull: Apply -q and -v options to rebase mode as well”
  1. pull: Apply -q and -v options to rebase mode as wellPeter Eisentraut, Mar 15, 2013
  2. Junio C HamanoMar 17, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.