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

Re: [PATCH] diff: allow --recurse-submodules as an synonym for --submodule

From
Stefan Beller <sbeller@google.com>
Date
Sep 6, 2018, 18:27 UTC
Message-ID
<CAGZ79kbBC9OxiMhOCjB61pQXaMa-_tXJdkPq_6JnzC+gDzRuAw@mail.gmail.com>
In-Reply-To
<20180905231258.GD120842@aiede.svl.corp.google.com>
On Wed, Sep 5, 2018 at 4:13 PM Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 49 quoted lines
>
> Stefan Beller wrote:
>
> > Many commands have flags to recurse into submodules, which is named
> > --recurse-submodules. The diff family also has a submodule recursion flag,
> > but that is named differently. Add a synonym --recurse-submodules, which
> > means the same as the --submodule flag, such that across all git commands
> > supporting submodules we have the --recurse-submodules flag available.
> >
> > Signed-off-by: Stefan Beller <sbeller@google.com>
> > ---
> >  Documentation/diff-options.txt | 1 +
> >  diff.c                         | 2 ++
> >  2 files changed, 3 insertions(+)
>
> Makes sense.
>
> [...]
> > --- a/Documentation/diff-options.txt
> > +++ b/Documentation/diff-options.txt
> > @@ -227,6 +227,7 @@ linkgit:git-config[1]).
> >       of the `--diff-filter` option on what the status letters mean.
> >
> >  --submodule[=<format>]::
> > +--recurse-submodules[=<format>]::
> >       Specify how differences in submodules are shown.  When specifying
> >       `--submodule=short` the 'short' format is used.  This format just
> >       shows the names of the commits at the beginning and end of the range.
> > diff --git a/diff.c b/diff.c
> > index 145cfbae592..d3d5a989bd1 100644
> > --- a/diff.c
> > +++ b/diff.c
> > @@ -5023,6 +5023,8 @@ int diff_opt_parse(struct diff_options *options,
> >               handle_ignore_submodules_arg(options, arg);
> >       } else if (skip_to_optional_arg_default(arg, "--submodule", &arg, "log"))
> >               return parse_submodule_opt(options, arg);
> > +     else if (skip_to_optional_arg_default(arg, "--recurse-submodules", &arg, "log"))
> > +             return parse_submodule_opt(options, arg);
>
> It seems like various commands are gaining --recurse-submodules options
> taking different kinds of arguments:
>
> - clone takes --recurse-submodules=<pathspec>
> - fetch takes --recurse-submodules=<mode>
> - after this patch, diff takes --recurse-submodules=<mode>
>
> Is there a unifying principle?  Can Documentation/gitsubmodules.txt
> say a word or two about what kind of argument values the user should
> expect to be accepted by these options?

I don't think there is a unifying principle deep down. Everything but clone is specifying a mode (you could imagine that we extend "git reset --recurse-submodules" as well to take some sort of mode, either the hard/soft differentiation or how to treat dirty submodules or a mode that could differentiate between superprojects sha1 and branch of the same name)

Care to send a patch on top to talk about these issues in Documentation/gitsubmodules.txt ?

Thanks, Stefan

Previous: Jonathan NiederNext: Junio C Hamano
Message 3 of 9 in “diff: allow --recurse-submodules as an synonym for --submodule”
  1. diff: allow --recurse-submodules as an synonym for --submoduleStefan Beller, Sep 5, 2018
  2. Jonathan NiederSep 5, 2018
  3. Stefan BellerSep 6, 2018
  4. Junio C HamanoSep 6, 2018
  5. Stefan BellerSep 6, 2018
  6. Jonathan NiederSep 7, 2018
  7. Junio C HamanoSep 7, 2018
  8. Martin ÅgrenSep 6, 2018
  9. diff: allow --recurse-submodules as an synonym for --submoduleStefan Beller, Sep 6, 2018

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.