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

Re: [PATCH] push: Improve --recurse-submodules support

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 2, 2015, 23:21 UTC
Message-ID
<xmqqsi3k4ety.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1449050172-1119-1-git-send-email-mac@mcrowe.com>
Mike Crowe <mac@mcrowe.com> writes:
Show 11 quoted lines
> b33a15b08131514b593015cb3e719faf9db20208 added support for the
> push.recurseSubmodules config option. After it was merged Junio C Hamano
> suggested some improvements:
>
>  - Declare recurse_submodules on a separate line.
>
>  - Accept multiple --recurse-submodules options on command line with the
>    last one winning. (This simplified the implementation too.)
>
> Also slightly improve one of the tests added in
> b33a15b08131514b593015cb3e719faf9db20208.

The above is overly verbose about how the commit materialized, compared to the description of the merit of this update.

    push: fix --recurse-submodules breakage
    When b33a15b0 (push: add recurseSubmodules config option,
    2015-11-17) added push.recurseSubmodules configuration option,
    it also changed the command line parsing to allow
    --no-recurse-submodules to override configured default.
    However, the parsing of configuration variables and command line
    options did not follow the usual "last one wins" convention.
    Fix this.
    Also fix the declaration of the new file-scope global variable
    to put it on a separate line on its own.
or something?

Also describe what "slightly improve" really means. What did the old one not test that should have been tested?

Thanks.
Show 20 quoted lines
> diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh
> index 9fda7b0..9a637f5 100755
> --- a/t/t5531-deep-submodule-push.sh
> +++ b/t/t5531-deep-submodule-push.sh
> @@ -126,7 +126,7 @@ test_expect_success 'push succeeds if submodule commit not on remote but using o
>  	)
>  '
>  
> -test_expect_success 'push fails if submodule commit not on remote using check from cmdline overriding config' '
> +test_expect_success 'push recurse-submodules cmdline overrides config' '
>  	(
>  		cd work/gar/bage &&
>  		>recurse-check-on-command-line-overriding-config &&
> @@ -142,8 +142,38 @@ test_expect_success 'push fails if submodule commit not on remote using check fr
>  		git fetch ../pub.git &&
>  		git diff --quiet FETCH_HEAD master^ &&
>  		# Check that the submodule commit did not get there
> -		cd gar/bage &&
> -		git diff --quiet origin/master master^
> +		(cd gar/bage && git diff --quiet origin/master master^) &&
These days, you can do:
		git -C gar/bage --quiet origin/master master^
instead.
Previous: Mike CroweNext: Mike Crowe
Message 5 of 16 in “push: add recurseSubmodules config option”
  1. push: add recurseSubmodules config optionMike Crowe, Dec 1, 2015
  2. Jeff KingDec 2, 2015
  3. Mike CroweDec 2, 2015
  4. push: Improve --recurse-submodules supportMike Crowe, Dec 2, 2015
  5. Junio C HamanoDec 2, 2015
  6. Mike CroweDec 3, 2015
  7. 1/2 push: Fully test --recurse-submodules on command line overrides configMike Crowe, Dec 3, 2015
  8. 2/2 push: Use "last one wins" convention for --recurse-submodulesMike Crowe, Dec 3, 2015
  9. Junio C HamanoDec 4, 2015
  10. Stefan BellerDec 10, 2015
  11. Junio C HamanoDec 10, 2015
  12. Stefan BellerDec 10, 2015
  13. Stefan BellerDec 16, 2015
  14. Junio C HamanoDec 16, 2015
  15. Stefan BellerDec 16, 2015
  16. Junio C HamanoDec 17, 2015

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.