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

[PATCH 0/5] submodule: add 'reversive' traversal options to foreach

From
WHWilliam Hatfield <whatfield.git@gmail.com>
Date
Jan 31, 2026, 21:43 UTC
Message-ID
<20260131214309.1899376-1-whatfield.git@gmail.com>

This series introduces robust post-order (dependency-ordered) traversal to `git submodule foreach` through three new flags: `--reverse-traversal`, `--append-superproject`, and the shorthand `--reversive`. These options allow users to process nested submodules before their parents and include the superproject in the operation, enabling reliable automation for dependency-ordered cleanup, builds, and deployment workflows.

Highlights:
- Implements all new traversal flags in both the C helper and shell script.
- Provides a comprehensive test suite (t7425) that validates the new behaviors.
- Updates documentation to describe the new options and their intended use.

These changes make submodule automation more powerful and flexible for advanced and dependency-sensitive use cases.

William Hatfield (5):
  t7425: add tests for reversive submodule traversal
  submodule: teach and plumb reverse-traversal behavior
  submodule: teach and plumb append-superproject behavior
  submodule: introduce reversive shorthand mode
  doc: document reversive traversal and related modes
 Documentation/git-submodule.adoc |  20 ++
 builtin/submodule--helper.c      |  98 ++++++++--
 git-submodule.sh                 |  13 ++
 t/meson.build                    |   1 +
 t/t7425-submodule-reversion.sh   | 314 +++++++++++++++++++++++++++++++
 5 files changed, 435 insertions(+), 11 deletions(-)
 create mode 100755 t/t7425-submodule-reversion.sh
-- 
2.53.0-rc0
Next: William Hatfield
Message 1 of 11 in “submodule: add 'reversive' traversal options to foreach”
  1. 0/5 submodule: add 'reversive' traversal options to foreachWilliam Hatfield, Jan 31, 2026
  2. 1/5 t7425: add tests for reversive submodule traversalWilliam Hatfield, Jan 31, 2026
  3. 2/5 submodule: teach and plumb reverse-traversal behaviorWilliam Hatfield, Jan 31, 2026
  4. 3/5 submodule: teach and plumb append-superproject behaviorWilliam Hatfield, Jan 31, 2026
  5. 4/5 submodule: introduce reversive shorthand modeWilliam Hatfield, Jan 31, 2026
  6. 5/5 doc: document reversive traversal and related modesWilliam Hatfield, Jan 31, 2026
  7. Jean-Noël AVILAFeb 1, 2026
  8. William HatfieldFeb 2, 2026
  9. Junio C HamanoFeb 2, 2026
  10. William HatfieldFeb 2, 2026
  11. Junio C HamanoFeb 2, 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.