Git development
 help / color / mirror / Atom feed
* [PATCH v2 0/2] fetch: make submodule fetch errors configurable
@ 2026-04-03  6:55 Paulius Zaleckas
  2026-04-03  6:55 ` [PATCH v2 1/2] submodule: fix premature failure in recursive submodule fetch Paulius Zaleckas
  2026-04-03  6:55 ` [PATCH v2 2/2] fetch: add fetch.submoduleErrors to make submodule fetch errors non-fatal Paulius Zaleckas
  0 siblings, 2 replies; 3+ messages in thread
From: Paulius Zaleckas @ 2026-04-03  6:55 UTC (permalink / raw)
  To: git; +Cc: Paulius Zaleckas

From: Paulius Zaleckas <paulius.zaleckas@gmail.com>

When fetching with --recurse-submodules, git currently exits with a
non-zero status if any submodule references an OID that is not reachable
from the submodule's remote.  This situation arises naturally when an
upstream branch is still in preparation (e.g. a topic branch in a merge
window): the local branch does not depend on the missing commit, so a
hard failure is unnecessarily disruptive.

Patch 1 fixes a pre-existing NEEDSWORK in submodule.c where a phase-1
fetch failure was recorded immediately, even when a phase-2 OID-based
retry was about to be scheduled.  After this fix the existing fatal
behaviour is preserved but the logic is now structured so that errors
are only recorded when the phase-2 retry actually fails.

Patch 2 introduces fetch.submoduleErrors (fail|warn) and
--submodule-errors=(fail|warn) to let users opt into non-fatal
behaviour.  The default remains fail for full backwards compatibility.

Changes in v2:
- Fix option synopsis to use (fail|warn) instead of <fail|warn>
- Add --submodule-errors documentation to Documentation/fetch-options.adoc

Paulius Zaleckas (2):
  submodule: fix premature failure in recursive submodule fetch
  fetch: add fetch.submoduleErrors to make submodule fetch errors
    non-fatal

 Documentation/config/fetch.adoc  | 14 +++++
 Documentation/fetch-options.adoc |  8 +++
 builtin/fetch.c                  | 39 ++++++++++++-
 submodule.c                      | 52 ++++++++++++-----
 submodule.h                      |  7 ++-
 t/t5526-fetch-submodules.sh      | 96 ++++++++++++++++++++++++++++++++
 6 files changed, 200 insertions(+), 16 deletions(-)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-03  6:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-03  6:55 [PATCH v2 0/2] fetch: make submodule fetch errors configurable Paulius Zaleckas
2026-04-03  6:55 ` [PATCH v2 1/2] submodule: fix premature failure in recursive submodule fetch Paulius Zaleckas
2026-04-03  6:55 ` [PATCH v2 2/2] fetch: add fetch.submoduleErrors to make submodule fetch errors non-fatal Paulius Zaleckas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox