{"thread":{"id":"20420","subject":"[PATCH] Make 'submodule update' honor the 'update' setting in .gitmodules.","startedAt":"2009-08-06T03:56:17Z","lastAt":"2009-08-07T21:54:53Z","messageCount":2,"participants":["Mikhail Glushenkov","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"119736","messageId":"1249530977-17501-1-git-send-email-foldr@codedgers.com","threadId":"20420","inReplyTo":null,"subject":"[PATCH] Make 'submodule update' honor the 'update' setting in .gitmodules.","fromName":"Mikhail Glushenkov","fromEmail":"foldr@codedgers.com","sentAt":"2009-08-06T03:56:17Z","receivedAt":"2009-08-06T03:56:17Z","isPatch":true,"sender":{"key":"foldr@codedgers.com","avatar":null},"body":"Make the 'submodule update' command honor the 'submodule.$path.update' setting\nin .gitmodules unless this setting is overridden in '.git/config' or with\n--rebase/--merge options.\n\nSigned-off-by: Mikhail Glushenkov <foldr@codedgers.com>\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 ebed711..636023a 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -372,6 +372,15 @@ cmd_update()\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+\n+\t\tif test -z \"$update_module\"\n+\t\tthen\n+\t\t    update_module=\"$(git config -f .gitmodules submodule.\"$name\".update)\"\n+\t\t    test -z \"$update_module\" ||\n+\t\t    git config submodule.\"$name\".update \"$update_module\" ||\n+\t\t    die \"Failed to register update mode for submodule path '$path'\"\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.6.4\n"},{"id":"119938","messageId":"7veirns30y.fsf@alter.siamese.dyndns.org","threadId":"20420","inReplyTo":"1249530977-17501-1-git-send-email-foldr@codedgers.com","subject":"Re: [PATCH] Make 'submodule update' honor the 'update' setting in .gitmodules.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-07T21:54:53Z","receivedAt":"2009-08-07T21:54:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mikhail Glushenkov <foldr@codedgers.com> writes:\n\n> Make the 'submodule update' command honor the 'submodule.$path.update' setting\n> in .gitmodules unless this setting is overridden in '.git/config' or with\n> --rebase/--merge options.\n\nI haven't been involved in recent updates to \"git submodule\", but the\nchange in this patch feels somewhat wrong.\n\nThe contents of in-tree .gitmodules are meant to be consulted to only\nprime the settings in .git/config, and after that they are never used\nwithout user's explicit concent (e.g. \"sync\").  At least that is the way I\nunderstand how the current \"git submodule\" command is designed.\n\nThis change actively breaks the pattern.  It makes sense to set up values\nfor \"submodule.*.update\" when the defaults suggested by the project are\ncopied out of .gitmodules to prime .git/config upon \"submodule init\", but\nnot at runtime in \"update\" command like this.\n\nI am puzzled.  What problem are you trying to solve?\n\n\"submodule init\" seems to already copy \"update\" setting from .gitmodules\nto .git/config.  At least, it seems to have a code to try to do so.\n\nPerhaps you would want to (1) add the \"submodule.*.update\" to the set of\nconfigurations to be copied upon \"sync\", not just URL? and (2) add a way\nto allow users to inspect how values in .git/config and .gitmodules are\ndifferent, and update .git/config with selected values, possibly in an\ninteractive manner?\n"}]}