git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Feature Request: Submodule Warning When Cloning Repos
@ 2021-09-16 16:59 Geoffrey Knopf
  2021-09-17  5:23 ` Bagas Sanjaya
  0 siblings, 1 reply; 3+ messages in thread
From: Geoffrey Knopf @ 2021-09-16 16:59 UTC (permalink / raw)
  To: git

Problem:
Easy to forget to clone submodules.

Existing Solutions:
Always clone repos that have submodules with the "--recurse-submodules" option.
Manually look inside the git ".submodules" file to see if there are any submodules and initialize and update them.

Request:
When performing a clone, warn the user if there are any submodules that have not been cloned.
Recommend that the user try the "--recurse-submodules" option next time or initialize and update the submodules.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Feature Request: Submodule Warning When Cloning Repos
  2021-09-16 16:59 Feature Request: Submodule Warning When Cloning Repos Geoffrey Knopf
@ 2021-09-17  5:23 ` Bagas Sanjaya
  2021-09-17 16:26   ` [EXT] " Geoffrey Knopf
  0 siblings, 1 reply; 3+ messages in thread
From: Bagas Sanjaya @ 2021-09-17  5:23 UTC (permalink / raw)
  To: Geoffrey Knopf, git

On 16/09/21 23.59, Geoffrey Knopf wrote:
> Problem:
> Easy to forget to clone submodules.
> 
> Existing Solutions:
> Always clone repos that have submodules with the "--recurse-submodules" option.
> Manually look inside the git ".submodules" file to see if there are any submodules and initialize and update them.
> 
> Request:
> When performing a clone, warn the user if there are any submodules that have not been cloned.
> Recommend that the user try the "--recurse-submodules" option next time or initialize and update the submodules.
> 

I don't think warning should be granted in this case. Maybe better as note?

 From what you wrote above, did you mean print the message when cloning 
any repo with submodules?

-- 
An old man doll... just what I always wanted! - Clara

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [EXT] Re: Feature Request: Submodule Warning When Cloning Repos
  2021-09-17  5:23 ` Bagas Sanjaya
@ 2021-09-17 16:26   ` Geoffrey Knopf
  0 siblings, 0 replies; 3+ messages in thread
From: Geoffrey Knopf @ 2021-09-17 16:26 UTC (permalink / raw)
  To: Bagas Sanjaya, git

Yeah could be a note. Thinking it could be printed to stdout when cloning.
I don't think there should be a prompt because that would interfere with automated cloning which needs to continue working.

Something like this:
"Note: This repo contains submodules which were not cloned:
- Submodule A
- Submodule B
Try the '--recurse-submodules' option next time to clone them automatically.
Or run 'git submodule init && git submodule update' to clone them now."

It doesn't need to print out every time a repo with submodules is cloned.
Only when a repo with submodules is cloned and the "--recurse-submodules" option was not used.
In other words, if there are submodules which have not been cloned/initialized/updated.

Backstory:
I've encountered a few situations where developers cloned a repo that they didn't know contained submodules.
Sometimes it was their first time encountering a repo with submodules so they didn't know to be on the lookout for that.
They tried to build per README instructions and it failed.
Then someone that knew there were submodules had to inform them to run 'git submodule init && git submodule update'.
To cover all bases, the submodules and git commands for cloning them had to be documented in the README.
This adds overhead to the READMEs of all projects containing submodules or causes development time to be lost.
I believe that if git printed the note mentioned above it would make cloning repos with submodules more intuitive and user-friendly.


From: Bagas Sanjaya <bagasdotme@gmail.com>
Sent: Thursday, September 16, 2021 10:23 PM
To: Geoffrey Knopf <gknopf@spideroak-inc.com>; git@vger.kernel.org <git@vger.kernel.org>
Subject: [EXT] Re: Feature Request: Submodule Warning When Cloning Repos 
 
On 16/09/21 23.59, Geoffrey Knopf wrote:
> Problem:
> Easy to forget to clone submodules.
> 
> Existing Solutions:
> Always clone repos that have submodules with the "--recurse-submodules" option.
> Manually look inside the git ".submodules" file to see if there are any submodules and initialize and update them.
> 
> Request:
> When performing a clone, warn the user if there are any submodules that have not been cloned.
> Recommend that the user try the "--recurse-submodules" option next time or initialize and update the submodules.
> 

I don't think warning should be granted in this case. Maybe better as note?

 From what you wrote above, did you mean print the message when cloning 
any repo with submodules?

-- 
An old man doll... just what I always wanted! - Clara

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-17 16:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16 16:59 Feature Request: Submodule Warning When Cloning Repos Geoffrey Knopf
2021-09-17  5:23 ` Bagas Sanjaya
2021-09-17 16:26   ` [EXT] " Geoffrey Knopf

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 NNTP newsgroup(s).