threads / patch / 44162

patchDocumentation/fetch-options: emit recurse-submodules, jobs unconditionally

Subject: [PATCH] Documentation/fetch-options: emit recurse-submodules, jobs unconditionally

## tl;dr

6 messages between Sep 26, 2016 and Sep 26, 2016. Diffs are folded; open one to read it.

replies: 5people: 3as markdown or json

Stefan Beller· Sep 26, 2016, 19:35 UTC · lore

Currently the section about recursing into submodules is repeated in git-pull word for word as it is in fetch-options.

Don't repeat ourselves here and include the --recurse-submodules via fetch options.

As a bonus expose the --jobs parameter in git-pull as well as that is declared as a OPT_PASSTHRU for fetch internally already.

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 Documentation/fetch-options.txt | 2 ++
 Documentation/git-pull.txt      | 9 ---------
 2 files changed, 2 insertions(+), 9 deletions(-)
Show changes to 2 files +2 −8

Documentation/fetch-options.txt, Documentation/git-pull.txt

diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt
index 9eab1f5..352b640 100644
--- a/Documentation/fetch-options.txt
+++ b/Documentation/fetch-options.txt
@@ -89,6 +89,7 @@ ifndef::git-pull[]
 	option alone does not subject tags to pruning, even if --prune
 	is used (though tags may be pruned anyway if they are also the
 	destination of an explicit refspec; see `--prune`).
+endif::git-pull[]
 
 --recurse-submodules[=yes|on-demand|no]::
 	This option controls if and under what conditions new commits of
@@ -108,6 +109,7 @@ ifndef::git-pull[]
 	submodules will be faster. By default submodules will be fetched
 	one at a time.
 
+ifndef::git-pull[]
 --no-recurse-submodules::
 	Disable recursive fetching of submodules (this has the same effect as
 	using the `--recurse-submodules=no` option).
diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
index d033b25..e4cd56a 100644
--- a/Documentation/git-pull.txt
+++ b/Documentation/git-pull.txt
@@ -84,15 +84,6 @@ OPTIONS
 --verbose::
 	Pass --verbose to git-fetch and git-merge.
 
---[no-]recurse-submodules[=yes|on-demand|no]::
-	This option controls if new commits of all populated submodules should
-	be fetched too (see linkgit:git-config[1] and linkgit:gitmodules[5]).
-	That might be necessary to get the data needed for merging submodule
-	commits, a feature Git learned in 1.7.3. Notice that the result of a
-	merge will not be checked out in the submodule, "git submodule update"
-	has to be called afterwards to bring the work tree up to date with the
-	merge result.
-
 Options related to merging
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-- 
2.10.0.129.g35f6318
Junio C Hamano· Sep 26, 2016, 20:29 UTC · re: Stefan Beller · lore

Re: [PATCH] Documentation/fetch-options: emit recurse-submodules, jobs unconditionally

Stefan Beller <sbeller@google.com> writes:
Show 8 quoted lines
> Currently the section about recursing into submodules is repeated in
> git-pull word for word as it is in fetch-options.
>
> Don't repeat ourselves here and include the --recurse-submodules via
> fetch options.
>
> As a bonus expose the --jobs parameter in git-pull as well as that is
> declared as a OPT_PASSTHRU for fetch internally already.

The above may not be technically wrong, but smells like an under-researched description.

IOW, "Why did the commit that introduced the option described it this way in the first place? Was there a specific reason why it had to be that way, and that reason is no longer with us now, which makes this change safe?" is a very natural question somebody who sees this patch, and your description does not answer it.

It seems that the option to recurse into submodules was added by Jens's 7dce19d3 ("fetch/pull: Add the --recurse-submodules option", 2010-11-12) to both fetch and pull at the same time. I suspected perhaps we hid it from pull initially while describing it for fetch, but that does not seem to be the case, and back at that version, pull and fetch shared the description without duplicating.

So where did we go wrong? Was there a good reason why we have two instances of these option descriptions, and if so, are we sure that that reason is no longer applicable to today's system that we can safely share the description? The proposed log message is a place to answer these questions.

By the way, 7dce19d3 is interesting in another way and worth studying in that it adds --submodule-prefix ;-) It may be something we want to consider consolidating with what Brandon has been working on.

By the way^2, the "unconditionally" on the title conveyed less information than their bits weigh. Unless a reader knows fetch-options are shared between fetch and pull, s/he would not know you meant by "unconditionally" to show these in both fetch and pull.

    Documentation: share more descriptions for options between fetch and pull
perhaps?
Thanks.
Stefan Beller· Sep 26, 2016, 20:44 UTC · re: Junio C Hamano · lore

Re: [PATCH] Documentation/fetch-options: emit recurse-submodules, jobs unconditionally

On Mon, Sep 26, 2016 at 1:29 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>> Currently the section about recursing into submodules is repeated in
>> git-pull word for word as it is in fetch-options.
>>
>> Don't repeat ourselves here and include the --recurse-submodules via
>> fetch options.
>>
>> As a bonus expose the --jobs parameter in git-pull as well as that is
>> declared as a OPT_PASSTHRU for fetch internally already.
>
> The above may not be technically wrong, but smells like an
> under-researched description.

I knew this question was coming, but the research was not as easy to follow as it seemed convoluted to me.

After a bit more research, I think 8f0700dd33f (fetch/pull: Add the 'on-demand' value to the --recurse-submodules option) is the culprit, where this patch should have been squashed into, as that made the both locations word for word equal.

Show 6 quoted lines
>
> So where did we go wrong?  Was there a good reason why we have two
> instances of these option descriptions, and if so, are we sure that
> that reason is no longer applicable to today's system that we can
> safely share the description?  The proposed log message is a place
> to answer these questions.

The commit above is where we went wrong; It doesn't seem like a good reason for not including this is given in there.

Show 5 quoted lines
>
> By the way, 7dce19d3 is interesting in another way and worth
> studying in that it adds --submodule-prefix ;-) It may be something
> we want to consider consolidating with what Brandon has been working
> on.
That's why Brandon is cc'd now. :)
Show 9 quoted lines
>
> By the way^2, the "unconditionally" on the title conveyed less
> information than their bits weigh.  Unless a reader knows
> fetch-options are shared between fetch and pull, s/he would not know
> you meant by "unconditionally" to show these in both fetch and pull.
>
>     Documentation: share more descriptions for options between fetch and pull
>
> perhaps?

That's way better. I'll resend shortly.

Thanks, Stefan

Junio C Hamano· Sep 26, 2016, 20:54 UTC · re: Stefan Beller · lore

Re: [PATCH] Documentation/fetch-options: emit recurse-submodules, jobs unconditionally

Stefan Beller <sbeller@google.com> writes:
> After a bit more research, I think 8f0700dd33f (fetch/pull: Add the
> 'on-demand' value to the --recurse-submodules option) is the culprit,
> where this patch should have been squashed into, as that made the
> both locations word for word equal.

Hmph, my digging points to elsewhere. 7811d960 ("pull: Document the "--[no-]recurse-submodules" options", 2011-02-07) which is older than 8f0700dd ("fetch/pull: Add the 'on-demand' value to the --recurse-submodules option", 2011-03-06) seems to be the real change that pulled the description of recurse-submodules made in fetch-options into "show this only when we are not describing pull".

Unfortunately it is not clear why we actively wanted to be sketchier when showing "git help fetch"; otherwise the change would have been made to the existing description there without adding a new entry to "git-pull.txt".

Stefan Beller· Sep 26, 2016, 21:14 UTC · re: Junio C Hamano · lore

Re: [PATCH] Documentation/fetch-options: emit recurse-submodules, jobs unconditionally

On Mon, Sep 26, 2016 at 1:54 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>> After a bit more research, I think 8f0700dd33f (fetch/pull: Add the
>> 'on-demand' value to the --recurse-submodules option) is the culprit,
>> where this patch should have been squashed into, as that made the
>> both locations word for word equal.
>
> Hmph, my digging points to elsewhere.  7811d960 ("pull: Document the
> "--[no-]recurse-submodules" options", 2011-02-07)

That commit seems like it want to intentionally keep it different for fetch and pull (otherwise the fetch-options.txt would have been reworded there).

Rereading the actual option descriptions, I realize they are different. (Initially I used a diff tool to see if there is aminor difference, and I was surprised they were word for word identical; It must have been a mistake on copying one of the option texts)

The git-pull part actually conveys pull specific information, so let's drop this patch entirely.

Show 11 quoted lines
> which is older
> than 8f0700dd ("fetch/pull: Add the 'on-demand' value to the
> --recurse-submodules option", 2011-03-06) seems to be the real
> change that pulled the description of recurse-submodules made in
> fetch-options into "show this only when we are not describing pull".
>
> Unfortunately it is not clear why we actively wanted to be sketchier
> when showing "git help fetch"; otherwise the change would have been
> made to the existing description there without adding a new entry to
> "git-pull.txt".
>
Brandon Williams· Sep 26, 2016, 22:18 UTC · re: Stefan Beller · lore

Re: [PATCH] Documentation/fetch-options: emit recurse-submodules, jobs unconditionally

Show 6 quoted lines
> > By the way, 7dce19d3 is interesting in another way and worth
> > studying in that it adds --submodule-prefix ;-) It may be something
> > we want to consider consolidating with what Brandon has been working
> > on.
> 
> That's why Brandon is cc'd now. :)

Interesting. Once we get something we agree on for adding the --submodule-prefix option to the top level we'll definitely have to update this section of code with the change.

-- 
Brandon Williams

← back to recent threads