{"thread":{"id":"16920","subject":"[PATCH] Pass --upload-pack and --receive-pack through submodules.","startedAt":"2008-12-30T02:44:15Z","lastAt":"2009-01-02T01:44:03Z","messageCount":4,"participants":["Jason Riedy","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"98934","messageId":"1230605055-30723-1-git-send-email-jason@acm.org","threadId":"16920","inReplyTo":null,"subject":"[PATCH] Pass --upload-pack and --receive-pack through submodules.","fromName":"Jason Riedy","fromEmail":"jason@acm.org","sentAt":"2008-12-30T02:44:15Z","receivedAt":"2008-12-30T02:44:15Z","isPatch":true,"sender":{"key":"jason@acm.org","avatar":"https://gravatar.com/avatar/7e80c271425fe9c47df4cb7cfaae91c4e7ac96badee28ad2c1fdd6f9916a54b0?d=mp&s=160"},"body":"While I no longer have to worry about a zillion ancient OS versions,\nI now have to worry about a remote site where I cannot control the\npath for non-interactive shells.  Thus, submodules need to handle\nexplicitly specified git-upload-pack and git-receive-pack programs.\n\nThere may be a fun shell quoting dance to avoid the extra conditionals.\nAny such dance would be even more confusing to read.\n\nSigned-off-by: Jason Riedy <jason@acm.org>\n---\n git-submodule.sh             |   81 +++++++++++++++++++++++++++++++++++++++--\n t/t7404-submodule-packbin.sh |   53 +++++++++++++++++++++++++++\n 2 files changed, 130 insertions(+), 4 deletions(-)\n create mode 100755 t/t7404-submodule-packbin.sh\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 2f47e06..1a8a968 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -90,6 +90,8 @@ module_clone()\n {\n \tpath=$1\n \turl=$2\n+\tuploadpack=$3\n+\treceivepack=$4\n \n \t# If there already is a directory at the submodule path,\n \t# expect it to be empty (since that is the default checkout\n@@ -105,8 +107,23 @@ module_clone()\n \ttest -e \"$path\" &&\n \tdie \"A file already exist at path '$path'\"\n \n-\tgit-clone -n \"$url\" \"$path\" ||\n+\tif test \"$uploadpack\"\n+\tthen\n+\t    git-clone --upload-pack $uploadpack -n \"$url\" \"$path\"\n+\telse\n+\t    git-clone -n \"$url\" \"$path\"\n+\tfi ||\n \tdie \"Clone of '$url' into submodule path '$path' failed\"\n+\tif test \"$uploadpack\"\n+\tthen\n+\t    git config -f \"${path}/.git/config\" remote.origin.uploadpack \"$uploadpack\" ||\n+\t    echo \"  Warn: Failed to set uploadpack for '$url' in submodule path '$path'.\"\n+\tfi\n+\tif test \"$receivepack\"\n+\tthen\n+\t    git config -f \"${path}/.git/config\" remote.origin.receivepack \"$receivepack\" ||\n+\t    echo \"  Warn: Failed to set receivepack for '$url' in submodule path '$path'.\"\n+\tfi\n }\n \n #\n@@ -130,6 +147,16 @@ cmd_add()\n \t\t-q|--quiet)\n \t\t\tquiet=1\n \t\t\t;;\n+\t\t-u|--upload-pack)\n+\t\t\tcase \"$2\" in '') usage ;; esac\n+\t\t\tuploadpack=$2\n+\t\t\tshift\n+\t\t\t;;\n+\t\t--receive-pack)\n+\t\t\tcase \"$2\" in '') usage ;; esac\n+\t\t\treceivepack=$2\n+\t\t\tshift\n+\t\t\t;;\n \t\t--)\n \t\t\tshift\n \t\t\tbreak\n@@ -191,9 +218,17 @@ cmd_add()\n \t\t\t;;\n \t\tesac\n \t\tgit config submodule.\"$path\".url \"$url\"\n+\t\tif test \"$uploadpack\"\n+\t\tthen\n+\t\t    git config submodule.\"$path\".uploadpack \"$uploadpack\"\n+\t\tfi\n+\t\tif test \"$receivepack\"\n+\t\tthen\n+\t\t    git config submodule.\"$path\".receivepack \"$receivepack\"\n+\t\tfi\n \telse\n \n-\t\tmodule_clone \"$path\" \"$realrepo\" || exit\n+\t\tmodule_clone \"$path\" \"$realrepo\" \"$uploadpack\" \"$receivepack\" || exit\n \t\t(unset GIT_DIR; cd \"$path\" && git checkout -f -q ${branch:+-b \"$branch\" \"origin/$branch\"}) ||\n \t\tdie \"Unable to checkout submodule '$path'\"\n \tfi\n@@ -202,7 +237,19 @@ cmd_add()\n \tdie \"Failed to add submodule '$path'\"\n \n \tgit config -f .gitmodules submodule.\"$path\".path \"$path\" &&\n-\tgit config -f .gitmodules submodule.\"$path\".url \"$repo\" &&\n+\tgit config -f .gitmodules submodule.\"$path\".url \"$repo\" ||\n+\tdie \"Failed to register submodule '$path'\"\n+\n+\tif test \"$uploadpack\"\n+        then\n+\t    git config -f .gitmodules submodule.\"$path\".uploadpack \"$uploadpack\" ||\n+\t    die \"Failed to register submodule '$path'\"\n+\tfi\n+\tif test \"$receivepack\"\n+        then\n+\t    git config -f .gitmodules submodule.\"$path\".receivepack \"$receivepack\" ||\n+\t    die \"Failed to register submodule '$path'\"\n+\tfi\n \tgit add .gitmodules ||\n \tdie \"Failed to register submodule '$path'\"\n }\n@@ -277,6 +324,19 @@ cmd_init()\n \t\tgit config submodule.\"$name\".url \"$url\" ||\n \t\tdie \"Failed to register url for submodule path '$path'\"\n \n+\t\tuploadpack=$(git config -f .gitmodules submodule.\"$name\".uploadpack)\n+\t\treceivepack=$(git config -f .gitmodules submodule.\"$name\".receivepack)\n+\t\tif test \"$uploadpack\"\n+\t\tthen\n+\t\t    git config submodule.\"$name\".uploadpack \"$uploadpack\" ||\n+\t\t    echo \"  Warn: Failed to set uploadpack for '$url' in submodule path '$path'.\"\n+\t\tfi\n+\t\tif test \"$receivepack\"\n+\t\tthen\n+\t\t    git config submodule.\"$name\".receivepack \"$receivepack\" ||\n+\t\t    echo \"  Warn: Failed to set receivepack for '$url' in submodule path '$path'.\"\n+\t\tfi\n+\n \t\tsay \"Submodule '$name' ($url) registered for path '$path'\"\n \tdone\n }\n@@ -330,7 +390,8 @@ cmd_update()\n \n \t\tif ! test -d \"$path\"/.git -o -f \"$path\"/.git\n \t\tthen\n-\t\t\tmodule_clone \"$path\" \"$url\" || exit\n+\t\t\tmodule_clone \"$path\" \"$url\" \"$(git config submodule.\"$name\".uploadpack)\" \\\n+\t\t\t    \"$(git config submodule.\"$name\".receivepack)\" || exit\n \t\t\tsubsha1=\n \t\telse\n \t\t\tsubsha1=$(unset GIT_DIR; cd \"$path\" &&\n@@ -655,6 +716,18 @@ cmd_sync()\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\tuploadpack=$(git config -f .gitmodules submodule.\"$name\".uploadpack)\n+\t\t\treceivepack=$(git config -f .gitmodules submodule.\"$name\".receivepack)\n+\t\t\tif test \"$uploadpack\"\n+\t\t\tthen\n+\t\t\t    git config submodule.\"$name\".uploadpack \"$uploadpack\" ||\n+\t\t\t    echo \"  Warn: Failed to set uploadpack for '$url' in submodule path '$name'.\"\n+\t\t\tfi\n+\t\t\tif test \"$receivepack\"\n+\t\t\tthen\n+\t\t\t    git config submodule.\"$name\".receivepack \"$receivepack\" ||\n+\t\t\t    echo \"  Warn: Failed to set receivepack for '$url' in submodule path '$name'.\"\n+\t\t\tfi\n \t\t)\n \t\tfi\n \tdone\ndiff --git a/t/t7404-submodule-packbin.sh b/t/t7404-submodule-packbin.sh\nnew file mode 100755\nindex 0000000..d46b3e6\n--- /dev/null\n+++ b/t/t7404-submodule-packbin.sh\n@@ -0,0 +1,53 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 E. Jason Riedy\n+#\n+\n+test_description='git submodule with explicit pack programs\n+\n+These tests exercise git submodule with --upload-pack and --receive-pack arguments.\n+'\n+\n+. ./test-lib.sh\n+\n+test_expect_success setup '\n+\techo file > file &&\n+\tgit add file &&\n+\ttest_tick &&\n+\tgit commit -m upstream\n+\tgit clone . super &&\n+\tgit clone super submodule &&\n+\t(cd super &&\n+\t git submodule add --upload-pack \"${GIT_EXEC_PATH}/git-upload-pack\" --receive-pack \"${GIT_EXEC_PATH}/git-receive-pack\" ../submodule submodule &&\n+\t test_tick &&\n+\t git commit -m \"submodule\"\n+\t) &&\n+\tgit clone super super-clone &&\n+\t(cd super-clone && git submodule update --init)\n+'\n+\n+test_expect_success 'push submodule change' '\n+\t(cd super &&\n+         cd submodule &&\n+         git checkout master &&\n+\t echo second line >> file &&\n+\t test_tick &&\n+\t git commit -a -m \"change submodule inside\" &&\n+         git push origin +master:pushed\n+\t)\n+'\n+\n+test_expect_success 'pull submodule change' '\n+\t(cd submodule &&\n+         git pull . pushed &&\n+\t echo second line >> file &&\n+\t test_tick &&\n+\t git commit -a -m \"change submodule outside\"\n+\t) &&\n+        (cd super &&\n+         cd submodule &&\n+         git pull origin master\n+        )\n+'\n+\n+test_done\n-- \n1.6.0.2\n"},{"id":"98975","messageId":"1230649782-14710-1-git-send-email-jason@acm.org","threadId":"16920","inReplyTo":"1230605055-30723-1-git-send-email-jason@acm.org","subject":"[PATCH] Pass --upload-pack and --receive-pack through submodules.","fromName":"Jason Riedy","fromEmail":"jason@acm.org","sentAt":"2008-12-30T15:09:42Z","receivedAt":"2008-12-30T15:09:42Z","isPatch":true,"sender":{"key":"jason@acm.org","avatar":"https://gravatar.com/avatar/7e80c271425fe9c47df4cb7cfaae91c4e7ac96badee28ad2c1fdd6f9916a54b0?d=mp&s=160"},"body":"While I no longer have to worry about a zillion ancient OS versions,\nI now have to worry about a remote site where I cannot control the\npath for non-interactive shells.  Thus, submodules need to handle\nexplicitly specified git-upload-pack and git-receive-pack programs.\n\nThere may be a fun shell quoting dance to avoid the extra conditionals.\nAny such dance would be even more confusing to read.\n\nSigned-off-by: Jason Riedy <jason@acm.org>\n---\n  Sorry; I forgot the documentation patch last time.  And it might be\n  better just to copy the entire submodule config directly to the remote\n  section...\n\n Documentation/git-submodule.txt |   15 +++++++-\n Documentation/gitmodules.txt    |   13 ++++++-\n git-submodule.sh                |   81 +++++++++++++++++++++++++++++++++++++--\n t/t7404-submodule-packbin.sh    |   53 +++++++++++++++++++++++++\n 4 files changed, 156 insertions(+), 6 deletions(-)\n create mode 100755 t/t7404-submodule-packbin.sh\n\ndiff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\nindex 2f207fb..9e2de16 100644\n--- a/Documentation/git-submodule.txt\n+++ b/Documentation/git-submodule.txt\n@@ -9,7 +9,7 @@ git-submodule - Initialize, update or inspect submodules\n SYNOPSIS\n --------\n [verse]\n-'git submodule' [--quiet] add [-b branch] [--] <repository> <path>\n+'git submodule' [--quiet] add [-b branch] [-u <git-upload-pack>] [--receive-pack <git-receive-pack>] [--] <repository> <path>\n 'git submodule' [--quiet] status [--cached] [--] [<path>...]\n 'git submodule' [--quiet] init [--] [<path>...]\n 'git submodule' [--quiet] update [--init] [--] [<path>...]\n@@ -159,6 +159,19 @@ OPTIONS\n --branch::\n \tBranch of repository to add as submodule.\n \n+--upload-pack <upload-pack>::\n+-u <upload-pack>::\n+\tWhen given, and the repository to clone from is accessed\n+\tvia ssh, this specifies a non-default path for the\n+\t'git-upload-pack' program on the remote end.  See\n+\tlinkgit:git-fetch-pack[1].\n+\n+--receive-pack <receive-pack>::\n+\tWhen given, and the repository to clone from is accessed\n+\tvia ssh, this specifies a non-default path for the\n+\t'git-receive-pack' program on the remote end.  See\n+\tlinkgit:git-push[1].\n+\n --cached::\n \tThis option is only valid for status and summary commands.  These\n \tcommands typically use the commit found in the submodule HEAD, but\ndiff --git a/Documentation/gitmodules.txt b/Documentation/gitmodules.txt\nindex d1a17e2..3387951 100644\n--- a/Documentation/gitmodules.txt\n+++ b/Documentation/gitmodules.txt\n@@ -30,6 +30,13 @@ submodule.<name>.path::\n submodule.<name>.url::\n \tDefines an url from where the submodule repository can be cloned.\n \n+submodule.<name>.receivepack::\n+\tThe default program to execute on the remote side when pushing.  See\n+\toption \\--receive-pack of linkgit:git-push[1].\n+\n+submodule.<name>.uploadpack::\n+\tThe default program to execute on the remote side when fetching.  See\n+\toption \\--upload-pack of linkgit:git-fetch-pack[1].\n \n EXAMPLES\n --------\n@@ -42,12 +49,16 @@ Consider the following .gitmodules file:\n \n \t[submodule \"libbar\"]\n \t\tpath = include/bar\n-\t\turl = git://bar.com/git/lib.git\n+\t\turl = ssh://bar.com/~/git/lib.git\n+\t\tuploadpack = /home/you/bin/git-upload-pack-wrapper\n+\t\treceivepack = /home/you/bin/git-receive-pack-wrapper\n \n \n This defines two submodules, `libfoo` and `libbar`. These are expected to\n be checked out in the paths 'include/foo' and 'include/bar', and for both\n submodules an url is specified which can be used for cloning the submodules.\n+For `libbar`, packs are retrieved and stored via the upload and receive\n+wrappers, respectively.\n \n SEE ALSO\n --------\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 2f47e06..1a8a968 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -90,6 +90,8 @@ module_clone()\n {\n \tpath=$1\n \turl=$2\n+\tuploadpack=$3\n+\treceivepack=$4\n \n \t# If there already is a directory at the submodule path,\n \t# expect it to be empty (since that is the default checkout\n@@ -105,8 +107,23 @@ module_clone()\n \ttest -e \"$path\" &&\n \tdie \"A file already exist at path '$path'\"\n \n-\tgit-clone -n \"$url\" \"$path\" ||\n+\tif test \"$uploadpack\"\n+\tthen\n+\t    git-clone --upload-pack $uploadpack -n \"$url\" \"$path\"\n+\telse\n+\t    git-clone -n \"$url\" \"$path\"\n+\tfi ||\n \tdie \"Clone of '$url' into submodule path '$path' failed\"\n+\tif test \"$uploadpack\"\n+\tthen\n+\t    git config -f \"${path}/.git/config\" remote.origin.uploadpack \"$uploadpack\" ||\n+\t    echo \"  Warn: Failed to set uploadpack for '$url' in submodule path '$path'.\"\n+\tfi\n+\tif test \"$receivepack\"\n+\tthen\n+\t    git config -f \"${path}/.git/config\" remote.origin.receivepack \"$receivepack\" ||\n+\t    echo \"  Warn: Failed to set receivepack for '$url' in submodule path '$path'.\"\n+\tfi\n }\n \n #\n@@ -130,6 +147,16 @@ cmd_add()\n \t\t-q|--quiet)\n \t\t\tquiet=1\n \t\t\t;;\n+\t\t-u|--upload-pack)\n+\t\t\tcase \"$2\" in '') usage ;; esac\n+\t\t\tuploadpack=$2\n+\t\t\tshift\n+\t\t\t;;\n+\t\t--receive-pack)\n+\t\t\tcase \"$2\" in '') usage ;; esac\n+\t\t\treceivepack=$2\n+\t\t\tshift\n+\t\t\t;;\n \t\t--)\n \t\t\tshift\n \t\t\tbreak\n@@ -191,9 +218,17 @@ cmd_add()\n \t\t\t;;\n \t\tesac\n \t\tgit config submodule.\"$path\".url \"$url\"\n+\t\tif test \"$uploadpack\"\n+\t\tthen\n+\t\t    git config submodule.\"$path\".uploadpack \"$uploadpack\"\n+\t\tfi\n+\t\tif test \"$receivepack\"\n+\t\tthen\n+\t\t    git config submodule.\"$path\".receivepack \"$receivepack\"\n+\t\tfi\n \telse\n \n-\t\tmodule_clone \"$path\" \"$realrepo\" || exit\n+\t\tmodule_clone \"$path\" \"$realrepo\" \"$uploadpack\" \"$receivepack\" || exit\n \t\t(unset GIT_DIR; cd \"$path\" && git checkout -f -q ${branch:+-b \"$branch\" \"origin/$branch\"}) ||\n \t\tdie \"Unable to checkout submodule '$path'\"\n \tfi\n@@ -202,7 +237,19 @@ cmd_add()\n \tdie \"Failed to add submodule '$path'\"\n \n \tgit config -f .gitmodules submodule.\"$path\".path \"$path\" &&\n-\tgit config -f .gitmodules submodule.\"$path\".url \"$repo\" &&\n+\tgit config -f .gitmodules submodule.\"$path\".url \"$repo\" ||\n+\tdie \"Failed to register submodule '$path'\"\n+\n+\tif test \"$uploadpack\"\n+        then\n+\t    git config -f .gitmodules submodule.\"$path\".uploadpack \"$uploadpack\" ||\n+\t    die \"Failed to register submodule '$path'\"\n+\tfi\n+\tif test \"$receivepack\"\n+        then\n+\t    git config -f .gitmodules submodule.\"$path\".receivepack \"$receivepack\" ||\n+\t    die \"Failed to register submodule '$path'\"\n+\tfi\n \tgit add .gitmodules ||\n \tdie \"Failed to register submodule '$path'\"\n }\n@@ -277,6 +324,19 @@ cmd_init()\n \t\tgit config submodule.\"$name\".url \"$url\" ||\n \t\tdie \"Failed to register url for submodule path '$path'\"\n \n+\t\tuploadpack=$(git config -f .gitmodules submodule.\"$name\".uploadpack)\n+\t\treceivepack=$(git config -f .gitmodules submodule.\"$name\".receivepack)\n+\t\tif test \"$uploadpack\"\n+\t\tthen\n+\t\t    git config submodule.\"$name\".uploadpack \"$uploadpack\" ||\n+\t\t    echo \"  Warn: Failed to set uploadpack for '$url' in submodule path '$path'.\"\n+\t\tfi\n+\t\tif test \"$receivepack\"\n+\t\tthen\n+\t\t    git config submodule.\"$name\".receivepack \"$receivepack\" ||\n+\t\t    echo \"  Warn: Failed to set receivepack for '$url' in submodule path '$path'.\"\n+\t\tfi\n+\n \t\tsay \"Submodule '$name' ($url) registered for path '$path'\"\n \tdone\n }\n@@ -330,7 +390,8 @@ cmd_update()\n \n \t\tif ! test -d \"$path\"/.git -o -f \"$path\"/.git\n \t\tthen\n-\t\t\tmodule_clone \"$path\" \"$url\" || exit\n+\t\t\tmodule_clone \"$path\" \"$url\" \"$(git config submodule.\"$name\".uploadpack)\" \\\n+\t\t\t    \"$(git config submodule.\"$name\".receivepack)\" || exit\n \t\t\tsubsha1=\n \t\telse\n \t\t\tsubsha1=$(unset GIT_DIR; cd \"$path\" &&\n@@ -655,6 +716,18 @@ cmd_sync()\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\tuploadpack=$(git config -f .gitmodules submodule.\"$name\".uploadpack)\n+\t\t\treceivepack=$(git config -f .gitmodules submodule.\"$name\".receivepack)\n+\t\t\tif test \"$uploadpack\"\n+\t\t\tthen\n+\t\t\t    git config submodule.\"$name\".uploadpack \"$uploadpack\" ||\n+\t\t\t    echo \"  Warn: Failed to set uploadpack for '$url' in submodule path '$name'.\"\n+\t\t\tfi\n+\t\t\tif test \"$receivepack\"\n+\t\t\tthen\n+\t\t\t    git config submodule.\"$name\".receivepack \"$receivepack\" ||\n+\t\t\t    echo \"  Warn: Failed to set receivepack for '$url' in submodule path '$name'.\"\n+\t\t\tfi\n \t\t)\n \t\tfi\n \tdone\ndiff --git a/t/t7404-submodule-packbin.sh b/t/t7404-submodule-packbin.sh\nnew file mode 100755\nindex 0000000..d46b3e6\n--- /dev/null\n+++ b/t/t7404-submodule-packbin.sh\n@@ -0,0 +1,53 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 E. Jason Riedy\n+#\n+\n+test_description='git submodule with explicit pack programs\n+\n+These tests exercise git submodule with --upload-pack and --receive-pack arguments.\n+'\n+\n+. ./test-lib.sh\n+\n+test_expect_success setup '\n+\techo file > file &&\n+\tgit add file &&\n+\ttest_tick &&\n+\tgit commit -m upstream\n+\tgit clone . super &&\n+\tgit clone super submodule &&\n+\t(cd super &&\n+\t git submodule add --upload-pack \"${GIT_EXEC_PATH}/git-upload-pack\" --receive-pack \"${GIT_EXEC_PATH}/git-receive-pack\" ../submodule submodule &&\n+\t test_tick &&\n+\t git commit -m \"submodule\"\n+\t) &&\n+\tgit clone super super-clone &&\n+\t(cd super-clone && git submodule update --init)\n+'\n+\n+test_expect_success 'push submodule change' '\n+\t(cd super &&\n+         cd submodule &&\n+         git checkout master &&\n+\t echo second line >> file &&\n+\t test_tick &&\n+\t git commit -a -m \"change submodule inside\" &&\n+         git push origin +master:pushed\n+\t)\n+'\n+\n+test_expect_success 'pull submodule change' '\n+\t(cd submodule &&\n+         git pull . pushed &&\n+\t echo second line >> file &&\n+\t test_tick &&\n+\t git commit -a -m \"change submodule outside\"\n+\t) &&\n+        (cd super &&\n+         cd submodule &&\n+         git pull origin master\n+        )\n+'\n+\n+test_done\n-- \n1.6.1.60.g1f086.dirty\n"},{"id":"99111","messageId":"7vy6xuhhbx.fsf@gitster.siamese.dyndns.org","threadId":"16920","inReplyTo":"1230649782-14710-1-git-send-email-jason@acm.org","subject":"Re: [PATCH] Pass --upload-pack and --receive-pack through submodules.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-01T21:00:50Z","receivedAt":"2009-01-01T21:00:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jason Riedy <jason@acm.org> writes:\n\n> While I no longer have to worry about a zillion ancient OS versions,\n> I now have to worry about a remote site where I cannot control the\n> path for non-interactive shells.  Thus, submodules need to handle\n> explicitly specified git-upload-pack and git-receive-pack programs.\n\nDo we (and can we) assume that the remote repositories submodules fetch\nfrom all reside on the same host and can share the same values for these\nparameters?  Shouldn't these instead be specified in the configuration\nfiles for the submodules, if they need to be nonstandard values?\n"},{"id":"99139","messageId":"878wpua3do.fsf@sparse.dyndns.org","threadId":"16920","inReplyTo":"7vy6xuhhbx.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Pass --upload-pack and --receive-pack through submodules.","fromName":"Jason Riedy","fromEmail":"jason@acm.org","sentAt":"2009-01-02T01:44:03Z","receivedAt":"2009-01-02T01:44:03Z","isPatch":true,"sender":{"key":"jason@acm.org","avatar":"https://gravatar.com/avatar/7e80c271425fe9c47df4cb7cfaae91c4e7ac96badee28ad2c1fdd6f9916a54b0?d=mp&s=160"},"body":"And Junio C. Hamano writes:\n> Do we (and can we) assume that the remote repositories submodules fetch\n> from all reside on the same host and can share the same values for these\n> parameters?  Shouldn't these instead be specified in the configuration\n> files for the submodules, if they need to be nonstandard values?\n\ngit does not and (for me) should not make the assumption above.\nI'm fetching different pieces from different administrative\ndomains where I also have push access.  While I could clone them\nall into one place, that adds another level of repositories I'd\nhave to keep up-to-date.\n\nEssentially, I'm collecting experimental libraries and drivers\ninto one build tree.  My intent is to record exactly what is\nbeing built on multiple machines while being able to push local\nbuild configurations back to my central superproject.  Then I can\nmake a version with pull-only remote URLs[1] for others to\nduplicate the setup for my experiments.\n\nI suppose I could clone the submodules by hand and then use git\nsubmodule add.  But then I'll have to build the structure by hand\n(with my own wrapper) everywhere I use the supermodule.  At that\npoint, using git submodule becomes a tad silly.  Or I could set\nup the superproject with pull-only URLs and modify the\nconfigurations with a separate wrapper.  Seemed like adding the\ntwo options to git submodule was easier.\n\nJason\n\nFootnotes: \n[1]  Or ask for separate pull- and push-urls in git remote.  But\nI haven't thought that through.\n"}]}