{"thread":{"id":"27561","subject":"[RFC PATCH 0/2] Add an update=none option for 'loose' submodules","startedAt":"2011-06-06T20:57:30Z","lastAt":"2011-06-09T18:06:42Z","messageCount":4,"participants":["Heiko Voigt","Jens Lehmann"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"169406","messageId":"cover.1307374519.git.hvoigt@hvoigt.net","threadId":"27561","inReplyTo":null,"subject":"[RFC PATCH 0/2] Add an update=none option for 'loose' submodules","fromName":"Heiko Voigt","fromEmail":"hvoigt@hvoigt.net","sentAt":"2011-06-06T20:57:30Z","receivedAt":"2011-06-06T20:57:30Z","isPatch":true,"sender":{"key":"hvoigt@hvoigt.net","avatar":"https://avatars.githubusercontent.com/u/184958?v=4"},"body":"If a submodule is used to seperate some bigger parts of a project into\nan optional directory it is helpful to not clone/update them by default.\n\nThis series implements a new value 'none' for submodule.<name>.update.\nIf this option is set a submodule will not be updated or cloned by\ndefault. If the user wants to work with the submodule he either needs\nto explicitely configure the update option to 'checkout' or pass\n--checkout as an option to the submodules. I chose this name to be\nconsistent with the existing --merge/--rebase options.\n\nWhat do you think about this approach?\n\nIf we agree that this is the correct way to approach this use case I\nwould proceed to implement tests and documentation.\n\nCheers Heiko\n\nHeiko Voigt (2):\n  submodule: move update configuration variable further up\n  add update 'none' flag to disable update of submodule by default\n\n git-submodule.sh |   22 ++++++++++++++++------\n 1 files changed, 16 insertions(+), 6 deletions(-)\n\n-- \n1.7.5.1.219.g4c6b2\n"},{"id":"169407","messageId":"4764d04d0faf6d71830094f91bd3743deb6e2d4e.1307374519.git.hvoigt@hvoigt.net","threadId":"27561","inReplyTo":"cover.1307374519.git.hvoigt@hvoigt.net","subject":"[RFC PATCH 1/2] submodule: move update configuration variable further up","fromName":"Heiko Voigt","fromEmail":"hvoigt@hvoigt.net","sentAt":"2011-06-06T20:57:31Z","receivedAt":"2011-06-06T20:57:31Z","isPatch":true,"sender":{"key":"hvoigt@hvoigt.net","avatar":"https://avatars.githubusercontent.com/u/184958?v=4"},"body":"Lets always initialize the 'update_module' variable with the final\nvalue. This way we allow code which wants to check this configuration\nearly to do so right in the beginning of cmd_update().\n---\n git-submodule.sh |   13 +++++++------\n 1 files changed, 7 insertions(+), 6 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex d189a24..70dfc7b 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -454,7 +454,13 @@ cmd_update()\n \t\tfi\n \t\tname=$(module_name \"$path\") || exit\n \t\turl=$(git config submodule.\"$name\".url)\n-\t\tupdate_module=$(git config submodule.\"$name\".update)\n+\t\tif ! test -z \"$update\"\n+\t\tthen\n+\t\t\tupdate_module=$update\n+\t\telse\n+\t\t\tupdate_module=$(git config submodule.\"$name\".update)\n+\t\tfi\n+\n \t\tif test -z \"$url\"\n \t\tthen\n \t\t\t# Only mention uninitialized submodules when its\n@@ -476,11 +482,6 @@ cmd_update()\n \t\t\tdie \"Unable to find current revision in submodule path '$path'\"\n \t\tfi\n \n-\t\tif ! test -z \"$update\"\n-\t\tthen\n-\t\t\tupdate_module=$update\n-\t\tfi\n-\n \t\tif test \"$subsha1\" != \"$sha1\"\n \t\tthen\n \t\t\tsubforce=$force\n-- \n1.7.5.1.219.g4c6b2\n"},{"id":"169408","messageId":"6d70cfcf08e7ff99d090a3d0e4f730e4f638d050.1307374519.git.hvoigt@hvoigt.net","threadId":"27561","inReplyTo":"cover.1307374519.git.hvoigt@hvoigt.net","subject":"[RFC PATCH 2/2] add update 'none' flag to disable update of submodule by default","fromName":"Heiko Voigt","fromEmail":"hvoigt@hvoigt.net","sentAt":"2011-06-06T20:57:32Z","receivedAt":"2011-06-06T20:57:32Z","isPatch":true,"sender":{"key":"hvoigt@hvoigt.net","avatar":"https://avatars.githubusercontent.com/u/184958?v=4"},"body":"This is useful to mark a submodule as unneeded by default. When this\noption is set and the user wants to work with such a submodule he\nneeds to configure 'submodule.<name>.update=checkout' or pass the\n--checkout option. Then the submodule can be handled like a normal\nsubmodule.\n\nTODO: Documentation/Tests\n---\n git-submodule.sh |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 70dfc7b..77977b5 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -423,6 +423,9 @@ cmd_update()\n \t\t--recursive)\n \t\t\trecursive=1\n \t\t\t;;\n+\t\t--checkout)\n+\t\t\tupdate=\"checkout\"\n+\t\t\t;;\n \t\t--)\n \t\t\tshift\n \t\t\tbreak\n@@ -461,6 +464,12 @@ cmd_update()\n \t\t\tupdate_module=$(git config submodule.\"$name\".update)\n \t\tfi\n \n+\t\tif test \"$update_module\" = \"none\"\n+\t\tthen\n+\t\t\techo \"Skipping submodule '$path'\"\n+\t\t\tcontinue\n+\t\tfi\n+\n \t\tif test -z \"$url\"\n \t\tthen\n \t\t\t# Only mention uninitialized submodules when its\n-- \n1.7.5.1.219.g4c6b2\n"},{"id":"169801","messageId":"4DF10BB2.9050500@web.de","threadId":"27561","inReplyTo":"cover.1307374519.git.hvoigt@hvoigt.net","subject":"Re: [RFC PATCH 0/2] Add an update=none option for 'loose' submodules","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2011-06-09T18:06:42Z","receivedAt":"2011-06-09T18:06:42Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 06.06.2011 22:57, schrieb Heiko Voigt:\n> If a submodule is used to seperate some bigger parts of a project into\n> an optional directory it is helpful to not clone/update them by default.\n\nI think this is a good idea as some people are running \"git submodule\nupdate --init --recursive\" when they have to update their submodules.\nIt would be nice to have an option to skip certain submodules then.\n\n> This series implements a new value 'none' for submodule.<name>.update.\n> If this option is set a submodule will not be updated or cloned by\n> default. If the user wants to work with the submodule he either needs\n> to explicitely configure the update option to 'checkout' or pass\n> --checkout as an option to the submodules. I chose this name to be\n> consistent with the existing --merge/--rebase options.\n> \n> What do you think about this approach?\n\nIt fits in nicely with my long term plan: Let the \"update\" flag\ncontrol what happens on submodule checkout in the work tree. Another\nflag (\"init\"?) can be added later to control if a submodule should be\ninitialized on clone or update, but that is outside the scope of this\nchange.\n\n> If we agree that this is the correct way to approach this use case I\n> would proceed to implement tests and documentation.\n\n+1 from me.\n"}]}