From: Jonathan Nieder <jrnieder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Stefan Beller <sbeller@google.com>, git@vger.kernel.org
Subject: Re: [PATCH] diff: allow --recurse-submodules as an synonym for --submodule
Date: Thu, 6 Sep 2018 23:40:26 -0700 [thread overview]
Message-ID: <20180907064026.GB172953@aiede.svl.corp.google.com> (raw)
In-Reply-To: <xmqqefe6z5ws.fsf@gitster-ct.c.googlers.com>
Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
>> 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 am not sure if the above is rhetorical. The only thing such a
> document can say about status-quo is that the user cannot make an
> educated guess, as there is no consistency. Some take an option to
> clarify which subset of submodules to act on, others take an option
> to specify what variant of operation to be made on the submodules.
It's not rhetorical: I really do want to find out what our plan is for
the future of --recurse-submodules.
One possibility (A) would be "accept pathspec everywhere", as you
mentioned. For a command like fetch that already accepts <mode>, that
is problematic and would involve a migration. If we already have to
migrate fetch, migrating diff as well does not seem too bad.
Another possibility (B) would be "accept pathspec in clone only". A
clone is a bit of a special case in that it is setting up the set of
active submodules; perhaps we want other commands to always respect
that set of active submodules without a method for overriding and only
acting on a subset. After all, "git checkout <branch>" doesn't have a
way to only checkout <branch> on a subset of the worktree; why should
"git checkout --recurse-submodules <branch>" be any different?
When I think about it this way, I suspect that (B) will provide a
better experience than (A), so this diff change doesn't seem like a
step in the wrong direction. Except: it took me a long time to think
this through. Some documentation really would help, since it would
mean that the next person can understand what the *intention* behind
these options are and save some time thinking through other not-chosen
alternatives.
Hmm?
Thanks,
Jonathan
next prev parent reply other threads:[~2018-09-07 6:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-05 22:58 [PATCH] diff: allow --recurse-submodules as an synonym for --submodule Stefan Beller
2018-09-05 23:12 ` Jonathan Nieder
2018-09-06 18:27 ` Stefan Beller
2018-09-06 21:12 ` Junio C Hamano
2018-09-06 21:25 ` Stefan Beller
2018-09-07 6:40 ` Jonathan Nieder [this message]
2018-09-07 9:53 ` Junio C Hamano
2018-09-06 6:19 ` Martin Ågren
2018-09-06 18:23 ` Stefan Beller
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180907064026.GB172953@aiede.svl.corp.google.com \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=sbeller@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).