{"thread":{"id":"56516","subject":"Feature Request: Submodule Warning When Cloning Repos","startedAt":"2021-09-16T17:03:46Z","lastAt":"2021-09-17T16:26:16Z","messageCount":3,"participants":["Geoffrey Knopf","Bagas Sanjaya"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"436130","messageId":"SA1PR17MB46101CC190E4CDDD00F2AD2C9BDC9@SA1PR17MB4610.namprd17.prod.outlook.com","threadId":"56516","inReplyTo":null,"subject":"Feature Request: Submodule Warning When Cloning Repos","fromName":"Geoffrey Knopf","fromEmail":"gknopf@spideroak-inc.com","sentAt":"2021-09-16T16:59:12Z","receivedAt":"2021-09-16T17:03:46Z","isPatch":false,"sender":{"key":"gknopf@spideroak-inc.com","avatar":null},"body":"Problem:\nEasy to forget to clone submodules.\n\nExisting Solutions:\nAlways clone repos that have submodules with the \"--recurse-submodules\" option.\nManually look inside the git \".submodules\" file to see if there are any submodules and initialize and update them.\n\nRequest:\nWhen performing a clone, warn the user if there are any submodules that have not been cloned.\nRecommend that the user try the \"--recurse-submodules\" option next time or initialize and update the submodules."},{"id":"436206","messageId":"3ff1426a-73a4-731e-3b6f-269d9a900019@gmail.com","threadId":"56516","inReplyTo":"SA1PR17MB46101CC190E4CDDD00F2AD2C9BDC9@SA1PR17MB4610.namprd17.prod.outlook.com","subject":"Re: Feature Request: Submodule Warning When Cloning Repos","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2021-09-17T05:23:16Z","receivedAt":"2021-09-17T05:23:21Z","isPatch":false,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"On 16/09/21 23.59, Geoffrey Knopf wrote:\n> Problem:\n> Easy to forget to clone submodules.\n> \n> Existing Solutions:\n> Always clone repos that have submodules with the \"--recurse-submodules\" option.\n> Manually look inside the git \".submodules\" file to see if there are any submodules and initialize and update them.\n> \n> Request:\n> When performing a clone, warn the user if there are any submodules that have not been cloned.\n> Recommend that the user try the \"--recurse-submodules\" option next time or initialize and update the submodules.\n> \n\nI don't think warning should be granted in this case. Maybe better as note?\n\n From what you wrote above, did you mean print the message when cloning \nany repo with submodules?\n\n-- \nAn old man doll... just what I always wanted! - Clara\n"},{"id":"436230","messageId":"SA1PR17MB4610F6F2BA6BC9D220EC5C4B9BDD9@SA1PR17MB4610.namprd17.prod.outlook.com","threadId":"56516","inReplyTo":"3ff1426a-73a4-731e-3b6f-269d9a900019@gmail.com","subject":"Re: [EXT] Re: Feature Request: Submodule Warning When Cloning Repos","fromName":"Geoffrey Knopf","fromEmail":"gknopf@spideroak-inc.com","sentAt":"2021-09-17T16:26:11Z","receivedAt":"2021-09-17T16:26:16Z","isPatch":false,"sender":{"key":"gknopf@spideroak-inc.com","avatar":null},"body":"Yeah could be a note. Thinking it could be printed to stdout when cloning.\nI don't think there should be a prompt because that would interfere with automated cloning which needs to continue working.\n\nSomething like this:\n\"Note: This repo contains submodules which were not cloned:\n- Submodule A\n- Submodule B\nTry the '--recurse-submodules' option next time to clone them automatically.\nOr run 'git submodule init && git submodule update' to clone them now.\"\n\nIt doesn't need to print out every time a repo with submodules is cloned.\nOnly when a repo with submodules is cloned and the \"--recurse-submodules\" option was not used.\nIn other words, if there are submodules which have not been cloned/initialized/updated.\n\nBackstory:\nI've encountered a few situations where developers cloned a repo that they didn't know contained submodules.\nSometimes it was their first time encountering a repo with submodules so they didn't know to be on the lookout for that.\nThey tried to build per README instructions and it failed.\nThen someone that knew there were submodules had to inform them to run 'git submodule init && git submodule update'.\nTo cover all bases, the submodules and git commands for cloning them had to be documented in the README.\nThis adds overhead to the READMEs of all projects containing submodules or causes development time to be lost.\nI believe that if git printed the note mentioned above it would make cloning repos with submodules more intuitive and user-friendly.\n\n\nFrom: Bagas Sanjaya <bagasdotme@gmail.com>\nSent: Thursday, September 16, 2021 10:23 PM\nTo: Geoffrey Knopf <gknopf@spideroak-inc.com>; git@vger.kernel.org <git@vger.kernel.org>\nSubject: [EXT] Re: Feature Request: Submodule Warning When Cloning Repos \n \nOn 16/09/21 23.59, Geoffrey Knopf wrote:\n> Problem:\n> Easy to forget to clone submodules.\n> \n> Existing Solutions:\n> Always clone repos that have submodules with the \"--recurse-submodules\" option.\n> Manually look inside the git \".submodules\" file to see if there are any submodules and initialize and update them.\n> \n> Request:\n> When performing a clone, warn the user if there are any submodules that have not been cloned.\n> Recommend that the user try the \"--recurse-submodules\" option next time or initialize and update the submodules.\n> \n\nI don't think warning should be granted in this case. Maybe better as note?\n\n From what you wrote above, did you mean print the message when cloning \nany repo with submodules?\n\n-- \nAn old man doll... just what I always wanted! - Clara"}]}