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

Re: [PATCH 2/2] fetch: add fetch.submoduleErrors to make submodule fetch errors non-fatal

From
Jean-Noël AVILA <avila.jn@gmail.com>
Date
Mar 31, 2026, 16:44 UTC
Message-ID
<2285132.irdbgypaU6@piment-oiseau>
In-Reply-To
<20260330173938.3792358-3-paulius.zaleckas@gmail.com>
On Monday, 30 March 2026 19:39:38 CEST Paulius Zaleckas wrote:
Show 24 quoted lines
> When fetching with --recurse-submodules, a submodule commit that is not
> yet reachable from any of the submodule's remote refs causes the entire
> fetch to fail.  This is overly strict when the missing commit belongs to
> an upstream branch that is still being prepared (e.g. an in-progress
> merge topic): the local branch does not need that commit, so there is no
> reason to treat its absence as fatal.
> 
> Add a new config key fetch.submoduleErrors (values: fail/warn) and a
> corresponding --submodule-errors=<fail|warn> command-line option that
> control this behaviour.  The default remains fail (existing behaviour);
> setting the value to warn causes submodule fetch failures to be reported
> on stderr without affecting the overall exit status of git fetch / git
> pull.
> 
> Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
> ---
>  Documentation/config/fetch.adoc | 14 +++++
>  builtin/fetch.c                 | 39 +++++++++++++-
>  submodule.c                     |  8 ++-
>  submodule.h                     |  7 ++-
>  t/t5526-fetch-submodules.sh     | 96 +++++++++++++++++++++++++++++++++
>  5 files changed, 160 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/config/fetch.adoc b/Documentation/config/
fetch.adoc
Show 7 quoted lines
> index cd40db0cad..8a6b68e57e 100644
> --- a/Documentation/config/fetch.adoc
> +++ b/Documentation/config/fetch.adoc
> @@ -1,3 +1,17 @@
> +`fetch.submoduleErrors`::
> +	Controls how errors from submodule fetches are handled when
> +	`--recurse-submodules` is in effect. When set to `fail` (the 
default),
> +	any submodule fetch error causes the overall `git fetch` or `git 
pull`
> +	to exit with a non-zero status. When set to `warn`, submodule fetch
> +	errors are reported to stderr but do not affect the exit status of 
the
> +	command. This is useful when working in repositories where some
> +	branches reference submodule commits that are not yet available on 
the
Show 5 quoted lines
> +	submodule remote, but those commits are not needed for the currently
> +	checked-out branch.
> ++
> +The value of this option can be overridden on the command line with
> +`--submodule-errors=<fail|warn>`.

These `fail` and `warn` are keywords, so the alternatives must be expressed in synopsis style as `--submodule-errors=(fail|warn)`

I also failed to find the documentation for this `--submodule-errors` option. Could you add it in the relevant manual pages?

> +
>  `fetch.recurseSubmodules`::
>  	This option controls whether `git fetch` (and the underlying fetch
>  	in `git pull`) will recursively fetch into populated submodules.
Previous: Paulius Zaleckas
Message 4 of 4 in “fetch: make submodule fetch errors configurable”
  1. 0/2 fetch: make submodule fetch errors configurablePaulius Zaleckas, Mar 30, 2026
  2. 1/2 submodule: fix premature failure in recursive submodule fetchPaulius Zaleckas, Mar 30, 2026
  3. 2/2 fetch: add fetch.submoduleErrors to make submodule fetch errors non-fatalPaulius Zaleckas, Mar 30, 2026
  4. Jean-Noël AVILAMar 31, 2026

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.