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

Re: [PATCH] push: add recurseSubmodules config option

From
Stefan Beller <sbeller@google.com>
Date
Nov 16, 2015, 18:15 UTC
Message-ID
<CAGZ79kacpWFFWiE-KjwEQZC+3PZw2MrpsgQWLJyS82X5LF+Lqw@mail.gmail.com>
In-Reply-To
<1447680294-13395-1-git-send-email-mac@mcrowe.com>
On Mon, Nov 16, 2015 at 5:24 AM, Mike Crowe <mac@mcrowe.com> wrote:
Show 14 quoted lines
> The --recurse-submodules command line parameter has existed for some
> time but it has no config file equivalent.
>
> Following the style of the corresponding parameter for git fetch, let's
> invent push.recurseSubmodules to provide a default for this
> parameter. This also requires the addition of --recurse-submodules=no to
> allow the configuration to be overridden on the command line when
> required.
>
> The most straightforward way to implement this appears to be to make
> push use code in submodule-config in a similar way to fetch.
>
> Signed-off-by: Mike Crowe <mac@mcrowe.com>
> ---
The code itself looks good to me, one nit in the tests though.
Show 19 quoted lines
> @@ -79,6 +87,119 @@ test_expect_success 'push succeeds after commit was pushed to remote' '
>         )
>  '
>
> +test_expect_success 'push succeeds if submodule commit not on remote but using on-demand on command line' '
> +       (
> +               cd work/gar/bage &&
> +               >recurse-on-demand-on-command-line &&
> +               git add recurse-on-demand-on-command-line &&
> +               git commit -m "Recurse on-demand on command line junk"
> +       ) &&
> +       (
> +               cd work &&
> +               git add gar/bage &&
> +               git commit -m "Recurse on-demand on command line for gar/bage" &&
> +               git push --recurse-submodules=on-demand ../pub.git master &&
> +               # Check that the supermodule commit got there
> +               git fetch ../pub.git &&
> +               git diff --quiet FETCH_HEAD master
Missing && chain here.
Show 6 quoted lines
> +               # Check that the submodule commit got there too
> +               cd gar/bage &&
> +               git diff --quiet origin/master master
> +       )
> +'
> +
Previous: Mike CroweNext: Mike Crowe
Message 2 of 7 in “push: add recurseSubmodules config option”
  1. push: add recurseSubmodules config optionMike Crowe, Nov 16, 2015
  2. Stefan BellerNov 16, 2015
  3. Mike CroweNov 16, 2015
  4. Jens LehmannNov 16, 2015
  5. Eric SunshineNov 16, 2015
  6. Junio C HamanoNov 30, 2015
  7. Mike CroweNov 30, 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.