Re: [EXT] Re: Feature Request: Submodule Warning When Cloning Repos

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
Sent: Thursday, September 16, 2021 10:23 PM
To: Geoffrey Knopf <gknopf@xxxxxxxxxxxxxxxxx>; git@xxxxxxxxxxxxxxx <git@xxxxxxxxxxxxxxx>
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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux