{"thread":{"id":"24779","subject":"[PATCH] submodule sync: Update \"submodule.<name>.url\"","startedAt":"2010-08-18T10:01:13Z","lastAt":"2010-08-18T15:58:33Z","messageCount":4,"participants":["David Aguilar","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"148354","messageId":"1282125673-22956-1-git-send-email-davvid@gmail.com","threadId":"24779","inReplyTo":null,"subject":"[PATCH] submodule sync: Update \"submodule.<name>.url\"","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2010-08-18T10:01:13Z","receivedAt":"2010-08-18T10:01:13Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"When \"git submodule sync\" synchronizes the repository URLs\nit only updates submodules' .git/config.  However, the old\nURLs still exist in the super-project's .git/config.\n\nUpdate the super-project's configuration so that commands\nsuch as \"git submodule update\" use the URLs from .gitmodules.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n git-submodule.sh          |    3 ++-\n t/t7403-submodule-sync.sh |    3 +++\n 2 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 170186f..be7e478 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -840,9 +840,10 @@ cmd_sync()\n \t\tthen\n \t\t(\n \t\t\tclear_local_git_env\n+\t\t\tsay \"Synchronizing submodule url for '$name'\"\n+\t\t\tgit config submodule.\"$name\".url \"$url\"\n \t\t\tcd \"$path\"\n \t\t\tremote=$(get_default_remote)\n-\t\t\tsay \"Synchronizing submodule url for '$name'\"\n \t\t\tgit config remote.\"$remote\".url \"$url\"\n \t\t)\n \t\tfi\ndiff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh\nindex 7538756..3033c4a 100755\n--- a/t/t7403-submodule-sync.sh\n+++ b/t/t7403-submodule-sync.sh\n@@ -58,6 +58,9 @@ test_expect_success '\"git submodule sync\" should update submodule URLs' '\n \t(cd super-clone/submodule &&\n \t git checkout master &&\n \t git pull\n+\t) &&\n+\t(cd super-clone &&\n+\t test -d \"$(git config submodule.submodule.url)\"\n \t)\n '\n \n-- \n1.7.2.1.97.g3235b.dirty\n"},{"id":"148356","messageId":"4C6BB9E2.4060700@viscovery.net","threadId":"24779","inReplyTo":"1282125673-22956-1-git-send-email-davvid@gmail.com","subject":"Re: [PATCH] submodule sync: Update \"submodule.<name>.url\"","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-08-18T10:45:54Z","receivedAt":"2010-08-18T10:45:54Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 8/18/2010 12:01, schrieb David Aguilar:\n> @@ -840,9 +840,10 @@ cmd_sync()\n>  \t\tthen\n>  \t\t(\n>  \t\t\tclear_local_git_env\n> +\t\t\tsay \"Synchronizing submodule url for '$name'\"\n> +\t\t\tgit config submodule.\"$name\".url \"$url\"\n\nThis git config applies to the super module, right? As such, shouldn't it\nhappen before you clear_local_git_env?\n\n>  \t\t\tcd \"$path\"\n>  \t\t\tremote=$(get_default_remote)\n> -\t\t\tsay \"Synchronizing submodule url for '$name'\"\n>  \t\t\tgit config remote.\"$remote\".url \"$url\"\n>  \t\t)\n\n-- Hannes\n"},{"id":"148388","messageId":"20100818154637.GA10028@gmail.com","threadId":"24779","inReplyTo":"4C6BB9E2.4060700@viscovery.net","subject":"Re: [PATCH] submodule sync: Update \"submodule.<name>.url\"","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2010-08-18T15:46:49Z","receivedAt":"2010-08-18T15:46:49Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Wed, Aug 18, 2010 at 12:45:54PM +0200, Johannes Sixt wrote:\n> Am 8/18/2010 12:01, schrieb David Aguilar:\n> > @@ -840,9 +840,10 @@ cmd_sync()\n> >  \t\tthen\n> >  \t\t(\n> >  \t\t\tclear_local_git_env\n> > +\t\t\tsay \"Synchronizing submodule url for '$name'\"\n> > +\t\t\tgit config submodule.\"$name\".url \"$url\"\n> \n> This git config applies to the super module, right? As such, shouldn't it\n> happen before you clear_local_git_env?\n\n\nGood catch, thanks.  I'll resend.\n\n\n> \n> >  \t\t\tcd \"$path\"\n> >  \t\t\tremote=$(get_default_remote)\n> > -\t\t\tsay \"Synchronizing submodule url for '$name'\"\n> >  \t\t\tgit config remote.\"$remote\".url \"$url\"\n> >  \t\t)\n> \n> -- Hannes\n\n-- \n\n\tDavid\n"},{"id":"148391","messageId":"1282147113-25816-1-git-send-email-davvid@gmail.com","threadId":"24779","inReplyTo":"4C6BB9E2.4060700@viscovery.net","subject":"[PATCH v2] submodule sync: Update \"submodule.<name>.url\"","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2010-08-18T15:58:33Z","receivedAt":"2010-08-18T15:58:33Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"When \"git submodule sync\" synchronizes the repository URLs\nit only updates submodules' .git/config.  However, the old\nURLs still exist in the super-project's .git/config.\n\nUpdate the super-project's configuration so that commands\nsuch as \"git submodule update\" use the URLs from .gitmodules.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n\nChanges since v1:\nWe now call clear_local_git_env after configuring\nthe super project (thanks Johannes).\n\n git-submodule.sh          |    3 ++-\n t/t7403-submodule-sync.sh |    3 +++\n 2 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 170186f..9ebbab7 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -839,10 +839,11 @@ cmd_sync()\n \t\tif test -e \"$path\"/.git\n \t\tthen\n \t\t(\n+\t\t\tsay \"Synchronizing submodule url for '$name'\"\n+\t\t\tgit config submodule.\"$name\".url \"$url\"\n \t\t\tclear_local_git_env\n \t\t\tcd \"$path\"\n \t\t\tremote=$(get_default_remote)\n-\t\t\tsay \"Synchronizing submodule url for '$name'\"\n \t\t\tgit config remote.\"$remote\".url \"$url\"\n \t\t)\n \t\tfi\ndiff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh\nindex 7538756..3033c4a 100755\n--- a/t/t7403-submodule-sync.sh\n+++ b/t/t7403-submodule-sync.sh\n@@ -58,6 +58,9 @@ test_expect_success '\"git submodule sync\" should update submodule URLs' '\n \t(cd super-clone/submodule &&\n \t git checkout master &&\n \t git pull\n+\t) &&\n+\t(cd super-clone &&\n+\t test -d \"$(git config submodule.submodule.url)\"\n \t)\n '\n \n-- \n1.7.2.1.97.g3235b\n"}]}