threads / discuss / 53021

RFC][Feature] submodule: teach subcommand 'summary' to give summary for nested submodules

Subject: RFC][Feature] submodule: teach subcommand 'summary' to give summary for nested submodules

## tl;dr

6 messages between Mar 18, 2020 and Mar 24, 2020.

replies: 5people: 3as markdown or json

Shourya Shukla· Mar 18, 2020, 16:32 UTC · lore
Hello everyone,

I was converting the subcommand 'summary'(of command submodule) from shell to C and I realised that the subcommand does not have a '--recursive' option in it, meaning it cannot give out summaries of nested submodules. My opinion on this is that an option should maybe exist for the same.

What are the community's thoughts on this? Should the aforementioned option be added? Is there any feasibility of this option in this case?

Regards, Shourya Shukla

Junio C Hamano· Mar 18, 2020, 19:48 UTC · re: Shourya Shukla · lore

Re: [RFC][Feature] submodule: teach subcommand 'summary' to give summary for nested submodules

Shourya Shukla <shouryashukla.oo@gmail.com> writes:
Show 9 quoted lines
> I was converting the subcommand 'summary'(of command submodule)
> from shell to C and I realised that the subcommand does not have a
> '--recursive' option in it, meaning it cannot give out summaries
> of nested submodules. My opinion on this is that an option should
> maybe exist for the same.
>
> What are the community's thoughts on this? Should the
> aforementioned option be added? Is there any feasibility of this
> option in this case?

If "git submodule summary --recursive" errors out with today's code, no sane user would be using it for any useful purpose, so I would think it is OK to add such a feature.

If it makes a usable UI for large projects that you can only choose between "include no subsubmodules" (i.e. with --no-recursive) or "include all sub(sub)*modules" (i.e. with --recursive) is another matter, though.

Shourya Shukla· Mar 19, 2020, 17:16 UTC · re: Junio C Hamano · lore

Re: Re: RFC][Feature] submodule

Hello Junio,
> If "git submodule summary --recursive" errors out with today's code,
> no sane user would be using it for any useful purpose, so I would
> think it is OK to add such a feature.
Sure thing! I will try to plan some makeshift implementation.
> If it makes a usable UI for large projects that you can only choose
> between "include no subsubmodules" (i.e. with --no-recursive) or
> "include all sub(sub)*modules" (i.e. with --recursive) is another
> matter, though.

I think discussing this idea may be a good approach right now? What you are saying for large projects does provoke thought though.. Also, what do you think may become a problem for large projects in here?

Thank you so much for the feedback BTW :)

Regards, Shourya Shukla

Junio C Hamano· Mar 19, 2020, 21:33 UTC · re: Shourya Shukla · lore

Re: RFC][Feature] submodule

Shourya Shukla <shouryashukla.oo@gmail.com> writes:
> Also, what do you think may become a problem for large projects in
> here?
Perhaps
    "We want submodule A and B's sub(sub)*modules all the way down
    to the leaf submodule, but directory C houses many submodules,
    among which only one can be active, and we want C/X and its
    sub(sub)*modules all the way down to the leaf but not C/Y nor
    C/Z or any other C/<anything>."
and similar requests along the line.
Shourya Shukla· Mar 20, 2020, 16:08 UTC · re: Junio C Hamano · lore

Re: Re: [RFC][Feature]

Show 5 quoted lines
>    "We want submodule A and B's sub(sub)*modules all the way down
>    to the leaf submodule, but directory C houses many submodules,
>    among which only one can be active, and we want C/X and its
>    sub(sub)*modules all the way down to the leaf but not C/Y nor
>    C/Z or any other C/<anything>."

That's a tough one. Would you advise developing the feature which may work atleast for the "normal" cases? In case it does not work for the aforementioned case and the like, we classify it as a BUG for further correction?

Regards, Shourya Shukla

Christian Couder· Mar 24, 2020, 07:29 UTC · re: Shourya Shukla · lore

Re: Re: [RFC][Feature]

On Fri, Mar 20, 2020 at 5:08 PM Shourya Shukla <shouryashukla.oo@gmail.com> wrote:

Show 11 quoted lines
>
> >    "We want submodule A and B's sub(sub)*modules all the way down
> >    to the leaf submodule, but directory C houses many submodules,
> >    among which only one can be active, and we want C/X and its
> >    sub(sub)*modules all the way down to the leaf but not C/Y nor
> >    C/Z or any other C/<anything>."
>
> That's a tough one. Would you advise developing the feature which may
> work atleast for the "normal" cases? In case it does not work for the
> aforementioned case and the like, we classify it as a BUG for further
> correction?

How are the other git-submodule sub-commands working with --recursive? Shouldn't --recursive work in the same way for all the sub-commands?

← back to recent threads