All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Blain <levraiphilippeblain@gmail.com>
To: Mahi Kolla via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Cc: Mahi Kolla <mahikolla@google.com>,
	Emily Shaffer <emilyshaffer@google.com>,
	Felipe Contreras <felipe.contreras@gmail.com>,
	Mahi Kolla <mkolla2@illinois.edu>
Subject: Re: [PATCH v6] clone: set submodule.recurse=true if submodule.stickyRecursiveClone enabled
Date: Wed, 18 Aug 2021 18:40:58 -0400	[thread overview]
Message-ID: <4103806f-6d88-2756-8853-7e16e56ad425@gmail.com> (raw)
In-Reply-To: <pull.1006.v6.git.1628903396783.gitgitgadget@gmail.com>

Hi Mahi, Emily and Junio,

Le 2021-08-13 à 21:09, Mahi Kolla via GitGitGadget a écrit :
> From: Mahi Kolla <mkolla2@illinois.edu>
> 
> Based on current experience, when running git clone --recurse-submodules,
> developers do not expect other commands such as pull or checkout to run
> recursively into active submodules. However, setting submodule.recurse=true
> at this step could make for a simpler workflow by eliminating the need for
> the --recurse-submodules option in subsequent commands. To collect more
> data on developers' preference in regards to making submodule.recurse=true
> a default config value in the future, deploy this feature under the opt in
> submodule.stickyRecursiveClone flag.
> 

As I mentioned upthread [1], I'm really not sure that we need a new config
variable. If people want to have "--recurse-submodules" the default behaviour
for all commands that know this flag, they can set 'submodule.recurse' in their
~/.gitconfig, which enables the behaviour for all those commands (except clone
and ls-files). And orgs shipping Git to their devs can set it in their system
gitconfig. I've been using this setup for over two years, with almost zero
adverse effect on repositories that do not contain submodules. The *only* bug that
I encountered that affects git commands when *no* submodules are at play was:

c56c48dd07 (grep: ignore --recurse-submodules if --no-index is given, 2020-01-30)

I understand that once submodule.recurse is set in the global or system config file,
then Git will start recursing in repos that were cloned prior to
that config being enabled, as Emily mentions in [2]. Personnally I think it's a positive
point. That *might* be a deal-breaker for other people,
but in any case it would be good that this alternative - just using 'submodule.recurse'
- is mentioned in the commit message and that it mentions that caveat, i.e. why we need
a separate config.

Le 2021-08-13 à 16:38, Emily Shaffer a écrit :
>  and apparently
> 'submodule.recurse=true' has some weird edge cases for commands which
> are happy to run out-of-repo.

It would be nice if those known edge cases were documented somewhere (on the list,
on Gitgitgadget's issues list or at https://bugs.chromium.org/p/git). Apart from
the 'grep --no-index' glitch that I mentioned above, I did not encounter any
myself.

> Signed-off-by: Mahi Kolla <mkolla2@illinois.edu>
> ---
>      clone: set submodule.recurse=true if submodule.stickyRecursiveClone
>      enabled
>      
>      Based on current experience, when running git clone
>      --recurse-submodules, developers do not expect other commands such as
>      pull or checkout to run recursively into active submodules. However,
>      setting submodule.recurse=true at this step could make for a simpler
>      workflow by eliminating the need for the --recurse-submodules option in
>      subsequent commands. To collect more data on developers' behavior and
>      preferences when making submodule.recurse=true a default, deploy this
>      feature under the opt in submodule.stickyRecursiveClone flag.
>      
>      Signed-off-by: Mahi Kolla mkolla2@illinois.edu

Mahi, you can keep just the "Since v1" part in the GGG PR description (and the
automatically added CC's). No need to also repeat the commit message.

>      
>      Since V1: Made this an opt in feature under a custom
>      submodule.stickyRecursiveClone flag as opposed to feature.experimental.
>      Updated tests to reflect this design change. Also updated commit
>      message. Additionally, I will be contributing from my personal email
>      going forward as opposed to my @google email.
>      
>      cc: Philippe Blain levraiphilippeblain@gmail.com

Small nit: since you used '/submit' several times on Gitgitgadget, the previous version
you sent was actually sent as v5, and this here version is v6. So for next round, you could
write "Changes since v6" :)

> 
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1006%2F24mahik%2Fmaster-v6
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1006/24mahik/master-v6
> Pull-Request: https://github.com/gitgitgadget/git/pull/1006
> 
> Range-diff vs v5:
> 
>  
>         
>       -+test_expect_success 'feature.experimental flag manipulates submodule.recurse value' '
>       ++test_expect_success 'submodule.stickyRecursiveClone flag manipulates submodule.recurse value' '
>        +
>       -+	test_config_global feature.experimental true &&
>       ++	test_config_global submodule.stickyRecursiveClone true &&
>        +	git clone --recurse-submodules parent clone_recurse_true &&
>        +	test_cmp_config -C clone_recurse_true true submodule.recurse &&
>        +
>       -+	test_config_global feature.experimental false &&
>       ++	test_config_global submodule.stickyRecursiveClone false &&
>        +	git clone --recurse-submodules parent clone_recurse_false &&
>        +	test_expect_code 1 git -C clone_recurse_false config --get submodule.recurse
>        +

OK, so the expectation with 'submodule.stickyRecursiveClone' is that :
-  if it's true, then 'submodule.recurse' is set to true in the clone's local config file.
    That makes sense.
- if it's false, then 'submodule.recurse' is not set in the clone. This means that
   if 'submodule.recurse' is already set in ~/.gitconfig (or the system config file)
   then the clone will respect the configured value. That also makes sense, I think.

> 
>   builtin/clone.c          |  6 ++++++
>   t/t5606-clone-options.sh | 12 ++++++++++++
>   2 files changed, 18 insertions(+)

The new config variable should be documented in Documentation/config/clone.txt (which
gets added to text of the git-config(1) man page).


Cheers,

Philippe.

[1] https://lore.kernel.org/git/xmqqa6le5x1f.fsf_-_@gitster.g/T/#m1c2e522368ec4c9d458fcf6d83e75afab1632306
[2] https://lore.kernel.org/git/YRbYWR+X8vSq8CYe@google.com/

      parent reply	other threads:[~2021-08-18 22:41 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-02 17:29 [PATCH 0/2] clone: update submodule.recurse in config when using --recurse-submodule Mahi Kolla via GitGitGadget
2021-08-02 17:29 ` [PATCH 1/2] " Mahi Kolla via GitGitGadget
2021-08-02 17:29 ` [PATCH 2/2] " Mahi Kolla via GitGitGadget
2021-08-02 22:38 ` [PATCH v2 0/3] " Mahi Kolla via GitGitGadget
2021-08-02 22:38   ` [PATCH v2 1/3] " Mahi Kolla via GitGitGadget
2021-08-02 22:38   ` [PATCH v2 2/3] " Mahi Kolla via GitGitGadget
2021-08-02 22:38   ` [PATCH v2 3/3] clone test: update whitespace according to style guide Mahi Kolla via GitGitGadget
2021-08-02 23:23   ` [PATCH v3 0/4] clone: update submodule.recurse in config when using --recurse-submodule Mahi Kolla via GitGitGadget
2021-08-02 23:23     ` [PATCH v3 1/4] " Mahi Kolla via GitGitGadget
2021-08-03  3:20       ` Philippe Blain
2021-08-07  3:06         ` Mahi Kolla
2021-08-02 23:23     ` [PATCH v3 2/4] " Mahi Kolla via GitGitGadget
2021-08-02 23:23     ` [PATCH v3 3/4] clone test: update whitespace according to style guide Mahi Kolla via GitGitGadget
2021-08-02 23:23     ` [PATCH v3 4/4] clone: " Mahi Kolla via GitGitGadget
2021-08-03  3:08     ` [PATCH v3 0/4] clone: update submodule.recurse in config when using --recurse-submodule Philippe Blain
2021-08-03 22:41     ` Junio C Hamano
2021-08-09 19:11     ` [PATCH v4] " Mahi Kolla via GitGitGadget
2021-08-09 21:15       ` Junio C Hamano
2021-08-10  7:26         ` Mahi Kolla
2021-08-10 18:36           ` Junio C Hamano
2021-08-10 23:04             ` Philippe Blain
2021-08-10 23:59               ` Mahi Kolla
2021-08-11  5:02             ` Junio C Hamano
2021-08-12  2:46       ` [PATCH v5] clone: set submodule.recurse=true if user enables feature.experimental flag Mahi Kolla via GitGitGadget
2021-08-12  4:20         ` Junio C Hamano
2021-08-12 23:54           ` Emily Shaffer
2021-08-13  3:35             ` Philippe Blain
2021-08-13  4:12               ` Mahi Kolla
2021-08-13 19:53                 ` Junio C Hamano
2021-08-13 14:59               ` Junio C Hamano
2021-08-13  4:34             ` Junio C Hamano
2021-08-13 20:23               ` Emily Shaffer
2021-08-13 20:30                 ` Junio C Hamano
2021-08-13 20:38                   ` Emily Shaffer
2021-08-13 20:48                     ` Mahi Kolla
2021-08-13 20:52                 ` Junio C Hamano
2021-08-13 17:33         ` Felipe Contreras
2021-08-14  1:09         ` [PATCH v6] clone: set submodule.recurse=true if submodule.stickyRecursiveClone enabled Mahi Kolla via GitGitGadget
2021-08-14 18:05           ` Junio C Hamano
2021-08-17 23:02             ` Emily Shaffer
2021-08-18 19:57               ` Junio C Hamano
2021-08-18 20:15                 ` [PATCH] fixup! " Junio C Hamano
2021-08-19 17:41                   ` Emily Shaffer
2021-08-30 20:59                     ` Emily Shaffer
2021-08-30 21:23                       ` Junio C Hamano
2021-08-18 22:40           ` Philippe Blain [this message]

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=4103806f-6d88-2756-8853-7e16e56ad425@gmail.com \
    --to=levraiphilippeblain@gmail.com \
    --cc=emilyshaffer@google.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=mahikolla@google.com \
    --cc=mkolla2@illinois.edu \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.