public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: William Hatfield <whatfield.git@gmail•com>
To: Junio C Hamano <gitster@pobox•com>
Cc: git@vger•kernel.org, glencbz@gmail•com, avarab@gmail•com, ps@pks•im
Subject: Re: [PATCH 0/5] submodule: add 'reversive' traversal options to foreach
Date: Mon, 2 Feb 2026 16:02:16 -0500	[thread overview]
Message-ID: <1F5D3AAF-3E5E-4AD0-A48B-90B9D545FB21@gmail.com> (raw)
In-Reply-To: <xmqqbji7yo3x.fsf@gitster.g>


> On Feb 2, 2026, at 1:52 PM, Junio C Hamano <gitster@pobox•com> wrote:
> 
> William Hatfield <whatfield.git@gmail•com> writes:
> 
>> 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.
> 
> A few comments on the overall structure and concepts.
> 
> * We do not want to see tests in a commit separate from the commit
>   that fixes.  The downside of such a layout of a series needs to
>   be understood.  An earlier step of a series may introduce a line
>   with "test_expect_failure" plus a short summary of what the piece
>   fixes, followed by a large amount of code to show exactly what is
>   being tested and expected outcome.  But when reading the step
>   that comes later that fixes the issue, readers will only see
>   changes from "test_expect_failure" to "test_expect success" with
>   most of the test to remind them what the issue was hidden away
>   from the view, in the post-context of patch hunk.  A commit that
>   has both the fix and the test that describes the expectation is
>   much easier to work with.
> 
> * The name "--reverse-traversal" makes sense only to those who know
>   what the normal traversal order is, but it is far from clear what
>   the normal submodule traversal order is, because there is no
>   "natural" order to traverse.  Any of the combination of "top
>   down/bottom up" "width first/depth first" would make sense
>   depending on the application.  If you are doing "bottom up", for
>   example, please name it as such.
> 
> * The name "--append-superproject" sounds strange.  It sounds as if
>   you are appending the superproject to something else, but I
>   suspect that is not what is happening; instead perhaps you are
>   leaving the traversal of the superproject at the end, or
>   something?
> 
> Thanks.

Thank you for the feedback, I will apply it in regard to test fixes in the same commit.

Do you have any recommendation regarding names of these flags?

Do you have a preference for: —postorder-traversal or —bottom-up-traversal?

What about: —include-superpoject or —execute-in-superproject-last?

  reply	other threads:[~2026-02-02 21:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-31 21:43 [PATCH 0/5] submodule: add 'reversive' traversal options to foreach William Hatfield
2026-01-31 21:43 ` [PATCH 1/5] t7425: add tests for reversive submodule traversal William Hatfield
2026-01-31 21:43 ` [PATCH 2/5] submodule: teach and plumb reverse-traversal behavior William Hatfield
2026-01-31 21:43 ` [PATCH 3/5] submodule: teach and plumb append-superproject behavior William Hatfield
2026-01-31 21:43 ` [PATCH 4/5] submodule: introduce reversive shorthand mode William Hatfield
2026-01-31 21:43 ` [PATCH 5/5] doc: document reversive traversal and related modes William Hatfield
2026-02-01  9:03   ` Jean-Noël AVILA
2026-02-02 21:10     ` William Hatfield
2026-02-02 18:52 ` [PATCH 0/5] submodule: add 'reversive' traversal options to foreach Junio C Hamano
2026-02-02 21:02   ` William Hatfield [this message]
2026-02-02 21:25     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1F5D3AAF-3E5E-4AD0-A48B-90B9D545FB21@gmail.com \
    --to=whatfield.git@gmail$(echo .)com \
    --cc=avarab@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=glencbz@gmail$(echo .)com \
    --cc=ps@pks$(echo .)im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox