{"thread":{"id":"30564","subject":"[PATCH 1/2] submodule: add tests for add,sync,init in presence of relative super origin URL","startedAt":"2012-05-19T04:40:02Z","lastAt":"2012-05-20T13:28:26Z","messageCount":10,"participants":["Jon Seymour","Jens Lehmann","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"191716","messageId":"1337402403-7546-1-git-send-email-jon.seymour@gmail.com","threadId":"30564","inReplyTo":null,"subject":"[PATCH 1/2] submodule: add tests for add,sync,init in presence of relative super origin URL","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2012-05-19T04:40:02Z","receivedAt":"2012-05-19T04:40:02Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"These tests are expected to fail, pending subsequent patch.\n\nSigned-off-by: Jon Seymour <jon.seymour@gmail.com>\n---\n t/t7400-submodule-basic.sh | 27 +++++++++++++++++++++++++++\n t/t7403-submodule-sync.sh  | 10 ++++++++++\n 2 files changed, 37 insertions(+)\n\ndiff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh\nindex 81827e6..1c40951 100755\n--- a/t/t7400-submodule-basic.sh\n+++ b/t/t7400-submodule-basic.sh\n@@ -507,6 +507,33 @@ test_expect_success 'relative path works with user@host:path' '\n \t)\n '\n \n+test_expect_failure 'relative path works with ../relative/repo' '\n+\t(\n+\t\tcd reltest &&\n+\t\tcp pristine-.git-config .git/config &&\n+\t\tgit config remote.origin.url ../relative/repo &&\n+\t\tgit submodule init &&\n+\t\ttest \"$(git config submodule.sub.url)\" = ../../relative/subrepo\n+\t)\n+'\n+\n+test_expect_failure 'test that submodule add creates the correct url when super origin url is relative' '\n+\tmkdir reladd &&\n+\t(\n+\t\tcd reladd &&\n+\t\tgit init &&\n+\t\tgit remote add origin ../relative/repo\n+\t\tmkdir sub &&\n+\t\t(\n+\t\t\tcd sub &&\n+\t\t\tgit init &&\n+\t\t\ttest_commit foo\n+\t\t) &&\n+\t\tgit submodule add ../subrepo ./sub &&\n+\t\ttest \"$(git config submodule.sub.url)\" = ../../relative/subrepo\n+\t)\n+'\n+\n test_expect_success 'moving the superproject does not break submodules' '\n \t(\n \t\tcd addtest &&\ndiff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh\nindex 3620215..788bc24 100755\n--- a/t/t7403-submodule-sync.sh\n+++ b/t/t7403-submodule-sync.sh\n@@ -86,4 +86,14 @@ test_expect_success '\"git submodule sync\" should not vivify uninteresting submod\n \t)\n '\n \n+test_expect_failure '\"git submodule sync\" should handle a super with a relative origin URL' '\n+\tgit clone super relative-clone &&\n+\t(cd relative-clone &&\n+\t git submodule update --init &&\n+\t git remote set-url origin ../relative/super.git &&\n+\t git submodule sync &&\n+\t test \"$(git config submodule.submodule.url)\" == ../../relative/moved-submodule\n+\t)\n+'\n+\n test_done\n-- \n1.7.10.2.649.gec87875\n"},{"id":"191717","messageId":"1337402403-7546-2-git-send-email-jon.seymour@gmail.com","threadId":"30564","inReplyTo":"1337402403-7546-1-git-send-email-jon.seymour@gmail.com","subject":"[PATCH 2/2] submodule: fix handling of supermodules with relative origin URLs","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2012-05-19T04:40:03Z","receivedAt":"2012-05-19T04:40:03Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"Prior to this change, an operation such as git submodule add, init or\nsync produced the wrong result when the origin URL of the supermodule\nwas itself a relative URL.\n\nThe issue arises in these cases, because the origin URL of\nthe supermodule needs to be prepended with a prefix that navigates\nfrom the submodule to the supermodule so that when the submodule\nURL is concatenated, the resulting url is relative to the working tree\nof the submodule.\n\nThis change ensures that this is done for add, sync and init.\n\nSigned-off-by: Jon Seymour <jon.seymour@gmail.com>\n---\n git-submodule.sh           | 35 ++++++++++++++++++++---------------\n t/t7400-submodule-basic.sh |  4 ++--\n t/t7403-submodule-sync.sh  |  2 +-\n 3 files changed, 23 insertions(+), 18 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 64a70d6..230c219 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -45,6 +45,10 @@ resolve_relative_url ()\n \t\t../*)\n \t\t\turl=\"${url#../}\"\n \t\t\tcase \"$remoteurl\" in\n+\t\t\t.*/*)\n+\t\t\t\tup_path=\"$(echo \"$2\" | sed \"s/[^/]*/../g\")\"\n+\t\t\t\tremoteurl=\"${up_path%/}/${remoteurl%/*}\"\n+\t\t\t\t;;\n \t\t\t*/*)\n \t\t\t\tremoteurl=\"${remoteurl%/*}\"\n \t\t\t\t;;\n@@ -235,11 +239,24 @@ cmd_add()\n \t\tusage\n \tfi\n \n+\t# normalize path:\n+\t# multiple //; leading ./; /./; /../; trailing /\n+\tsm_path=$(printf '%s/\\n' \"$sm_path\" |\n+\t\tsed -e '\n+\t\t\ts|//*|/|g\n+\t\t\ts|^\\(\\./\\)*||\n+\t\t\ts|/\\./|/|g\n+\t\t\t:start\n+\t\t\ts|\\([^/]*\\)/\\.\\./||\n+\t\t\ttstart\n+\t\t\ts|/*$||\n+\t\t')\n+\n \t# assure repo is absolute or relative to parent\n \tcase \"$repo\" in\n \t./*|../*)\n \t\t# dereference source url relative to parent's url\n-\t\trealrepo=$(resolve_relative_url \"$repo\") || exit\n+\t\trealrepo=$(resolve_relative_url \"$repo\" \"$sm_path\") || exit\n \t\t;;\n \t*:*|/*)\n \t\t# absolute url\n@@ -250,18 +267,6 @@ cmd_add()\n \t;;\n \tesac\n \n-\t# normalize path:\n-\t# multiple //; leading ./; /./; /../; trailing /\n-\tsm_path=$(printf '%s/\\n' \"$sm_path\" |\n-\t\tsed -e '\n-\t\t\ts|//*|/|g\n-\t\t\ts|^\\(\\./\\)*||\n-\t\t\ts|/\\./|/|g\n-\t\t\t:start\n-\t\t\ts|\\([^/]*\\)/\\.\\./||\n-\t\t\ttstart\n-\t\t\ts|/*$||\n-\t\t')\n \tgit ls-files --error-unmatch \"$sm_path\" > /dev/null 2>&1 &&\n \tdie \"$(eval_gettext \"'\\$sm_path' already exists in the index\")\"\n \n@@ -407,7 +412,7 @@ cmd_init()\n \t\t\t# Possibly a url relative to parent\n \t\t\tcase \"$url\" in\n \t\t\t./*|../*)\n-\t\t\t\turl=$(resolve_relative_url \"$url\") || exit\n+\t\t\t\turl=$(resolve_relative_url \"$url\" \"$sm_path\") || exit\n \t\t\t\t;;\n \t\t\tesac\n \t\t\tgit config submodule.\"$name\".url \"$url\" ||\n@@ -964,7 +969,7 @@ cmd_sync()\n \t\t# Possibly a url relative to parent\n \t\tcase \"$url\" in\n \t\t./*|../*)\n-\t\t\turl=$(resolve_relative_url \"$url\") || exit\n+\t\t\turl=$(resolve_relative_url \"$url\" \"$sm_path\") || exit\n \t\t\t;;\n \t\tesac\n \ndiff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh\nindex 1c40951..e10abc4 100755\n--- a/t/t7400-submodule-basic.sh\n+++ b/t/t7400-submodule-basic.sh\n@@ -507,7 +507,7 @@ test_expect_success 'relative path works with user@host:path' '\n \t)\n '\n \n-test_expect_failure 'relative path works with ../relative/repo' '\n+test_expect_success 'relative path works with ../relative/repo' '\n \t(\n \t\tcd reltest &&\n \t\tcp pristine-.git-config .git/config &&\n@@ -517,7 +517,7 @@ test_expect_failure 'relative path works with ../relative/repo' '\n \t)\n '\n \n-test_expect_failure 'test that submodule add creates the correct url when super origin url is relative' '\n+test_expect_success 'test that submodule add creates the correct url when super origin url is relative' '\n \tmkdir reladd &&\n \t(\n \t\tcd reladd &&\ndiff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh\nindex 788bc24..35700ef 100755\n--- a/t/t7403-submodule-sync.sh\n+++ b/t/t7403-submodule-sync.sh\n@@ -86,7 +86,7 @@ test_expect_success '\"git submodule sync\" should not vivify uninteresting submod\n \t)\n '\n \n-test_expect_failure '\"git submodule sync\" should handle a super with a relative origin URL' '\n+test_expect_success '\"git submodule sync\" should handle a super with a relative origin URL' '\n \tgit clone super relative-clone &&\n \t(cd relative-clone &&\n \t git submodule update --init &&\n-- \n1.7.10.2.649.gec87875\n"},{"id":"191742","messageId":"4FB7ECCF.9020403@web.de","threadId":"30564","inReplyTo":"1337402403-7546-2-git-send-email-jon.seymour@gmail.com","subject":"Re: [PATCH 2/2] submodule: fix handling of supermodules with relative origin URLs","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2012-05-19T18:56:15Z","receivedAt":"2012-05-19T18:56:15Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 19.05.2012 06:40, schrieb Jon Seymour:\n> Prior to this change, an operation such as git submodule add, init or\n> sync produced the wrong result when the origin URL of the supermodule\n> was itself a relative URL.\n> \n> The issue arises in these cases, because the origin URL of\n> the supermodule needs to be prepended with a prefix that navigates\n> from the submodule to the supermodule so that when the submodule\n> URL is concatenated, the resulting url is relative to the working tree\n> of the submodule.\n\nJust a small nit: I'd prefer to replace the 4 occurrences of the term\n\"supermodule\" with \"superproject\".\n\n\nBTW, what happened to the following comment in you other email?\n\n>> +                               remoteurl=\"${up_path%/}/${remoteurl%/*}\"\n>\n> Meant up_path%/ to be up_path%/*\n\nThe '*' is not there (but the test suite runs fine no matter if I add\na '*' there or not). Thinking about it not adding the '*' should be\ncorrect, as you just want to chop off a trailing '/' from $up_path\nhere, right?\n\nSo no objection on the code changes from my side.\n"},{"id":"191745","messageId":"CAH3AnrrqiXqdHHGZPyOPJ3Zend5JrQX0rKV+pz_mjs3SDjv9DA@mail.gmail.com","threadId":"30564","inReplyTo":"4FB7ECCF.9020403@web.de","subject":"Re: [PATCH 2/2] submodule: fix handling of supermodules with relative origin URLs","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2012-05-19T22:51:08Z","receivedAt":"2012-05-19T22:51:08Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On Sun, May 20, 2012 at 4:56 AM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n> Am 19.05.2012 06:40, schrieb Jon Seymour:\n>\n> Just a small nit: I'd prefer to replace the 4 occurrences of the term\n> \"supermodule\" with \"superproject\".\n\nSure. I can't argue with precedent, of course, but I guess I was\nfavouring the consistency in the suffixes used with sub and super.\n\n>\n>\n> BTW, what happened to the following comment in you other email?\n>\n>>> +                               remoteurl=\"${up_path%/}/${remoteurl%/*}\"\n>>\n>> Meant up_path%/ to be up_path%/*\n>\n> The '*' is not there (but the test suite runs fine no matter if I add\n> a '*' there or not). Thinking about it not adding the '*' should be\n> correct, as you just want to chop off a trailing '/' from $up_path\n> here, right?\n\nYes %/* was actually the wrong thing to do - my original intent was to\nremove repeated trailing occurrences of /, but, of course, %/* doesn't\ndo that, nor should it be necessary  (assuming the sm_path was\nnormalized during add).\n\n>\n> So no objection on the code changes from my side.\n\nI noticed one relative case that is not handled properly yet, but\nthere is a workaround. If the superproject's origin URL is of the\nform: foo/bar (a case I actually have myself for reasons I can explain\nif you want me to), then the correct rule doesn't get matched by\n.*/*). The workaround is for the user to change foo/bar style origin\nURLs to ./foo/bar.\n\nLet me know if I should fix this case now too.\n\njon.\n"},{"id":"191748","messageId":"CAH3AnrrxgT1OQe-K2A91XfMLSd2WGvJ5CzyNR4tRqvYfp4wgQg@mail.gmail.com","threadId":"30564","inReplyTo":"CAH3AnrrqiXqdHHGZPyOPJ3Zend5JrQX0rKV+pz_mjs3SDjv9DA@mail.gmail.com","subject":"Re: [PATCH 2/2] submodule: fix handling of supermodules with relative origin URLs","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2012-05-19T23:10:15Z","receivedAt":"2012-05-19T23:10:15Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On Sun, May 20, 2012 at 8:51 AM, Jon Seymour <jon.seymour@gmail.com> wrote:\n> On Sun, May 20, 2012 at 4:56 AM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n>> Am 19.05.2012 06:40, schrieb Jon Seymour:\n> I noticed one relative case that is not handled properly yet, but\n> there is a workaround. If the superproject's origin URL is of the\n> form: foo/bar (a case I actually have myself for reasons I can explain\n> if you want me to), then the correct rule doesn't get matched by\n> .*/*). The workaround is for the user to change foo/bar style origin\n> URLs to ./foo/bar.\n>\n> Let me know if I should fix this case now too.\n\nI think this expression:\n\n    remoteurl=$(echo \"remoteurl\" | sed \"s|^[^/][^:]*\\$|./&|\" )\n    remoteurl=${remoteurl%/}\n\nwould normalize remoteurl correctly for the foo/bar case and not any other.\n\nI'd also need to add at least one new test (or do I actually need 3?),\nof course.\n\njon.\n"},{"id":"191749","messageId":"CAH3Anrrq5+MgGMFn89zFaaeyRkcZ7d+PHKfpVhJhdt2dNpWZoQ@mail.gmail.com","threadId":"30564","inReplyTo":"CAH3AnrrxgT1OQe-K2A91XfMLSd2WGvJ5CzyNR4tRqvYfp4wgQg@mail.gmail.com","subject":"Re: [PATCH 2/2] submodule: fix handling of supermodules with relative origin URLs","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2012-05-19T23:45:57Z","receivedAt":"2012-05-19T23:45:57Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On Sun, May 20, 2012 at 9:10 AM, Jon Seymour <jon.seymour@gmail.com> wrote:\n> On Sun, May 20, 2012 at 8:51 AM, Jon Seymour <jon.seymour@gmail.com> wrote:\n>> On Sun, May 20, 2012 at 4:56 AM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n>>> Am 19.05.2012 06:40, schrieb Jon Seymour:\n>> I noticed one relative case that is not handled properly yet, but\n>> there is a workaround. If the superproject's origin URL is of the\n>> form: foo/bar (a case I actually have myself for reasons I can explain\n>> if you want me to), then the correct rule doesn't get matched by\n>> .*/*). The workaround is for the user to change foo/bar style origin\n>> URLs to ./foo/bar.\n>>\n>> Let me know if I should fix this case now too.\n>\n> I think this expression:\n>\n>    remoteurl=$(echo \"remoteurl\" | sed \"s|^[^/][^:]*\\$|./&|\" )\n>    remoteurl=${remoteurl%/}\n>\n> would normalize remoteurl correctly for the foo/bar case and not any other.\n>\n> I'd also need to add at least one new test (or do I actually need 3?),\n> of course.\n\nOk. I have a version that implements this fix:\n\n        url=\"$1\"\n+       remoteurl=$(echo \"$remoteurl\" | sed \"s|^[^/][^:]*\\$|./&|\")\n        remoteurl=${remoteurl%/}\n\nand...\n\n+                       .*/*)\n+                               up_path=\"$(echo \"$2\" | sed \"s/[^/]*/../g\")\"\n+                               remoteurl=${remoteurl#./}\n+                               remoteurl=\"${up_path%/}/${remoteurl%/*}\"\n+                               ;;\n\nwith a single test that demonstrates that it works. The additional #./\ntweak is so that submodule URLs end up like:\n\n   ../foo/sub\n\ninstead of:\n\n   ../foo/./sub\n\njon.\n"},{"id":"191750","messageId":"4FB83BFC.4000702@web.de","threadId":"30564","inReplyTo":"CAH3AnrrqiXqdHHGZPyOPJ3Zend5JrQX0rKV+pz_mjs3SDjv9DA@mail.gmail.com","subject":"Re: [PATCH 2/2] submodule: fix handling of supermodules with relative origin URLs","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2012-05-20T00:34:04Z","receivedAt":"2012-05-20T00:34:04Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 20.05.2012 00:51, schrieb Jon Seymour:\n> On Sun, May 20, 2012 at 4:56 AM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n>> Am 19.05.2012 06:40, schrieb Jon Seymour:\n>>\n>> Just a small nit: I'd prefer to replace the 4 occurrences of the term\n>> \"supermodule\" with \"superproject\".\n> \n> Sure. I can't argue with precedent, of course, but I guess I was\n> favouring the consistency in the suffixes used with sub and super.\n\nNo big deal, but in recent posts \"superproject\" has been used and\nthe similarity between \"supermodule\" and \"submodule\" fooled me when\nI read your RFC patch. So even though a superproject might be the a\nsubmodule of another superproject, I'm all for using the term\n\"superproject\" to make the distinction obvious.\n\n>> So no objection on the code changes from my side.\n> \n> I noticed one relative case that is not handled properly yet, but\n> there is a workaround. If the superproject's origin URL is of the\n> form: foo/bar (a case I actually have myself for reasons I can explain\n> if you want me to), then the correct rule doesn't get matched by\n> .*/*). The workaround is for the user to change foo/bar style origin\n> URLs to ./foo/bar.\n> \n> Let me know if I should fix this case now too.\n\nMe thinks that this is subject for a subsequent patch. Having the\nURL of the superproject *below* the root directory of the\nsuperproject seems like a rather odd case which warrants a fix of\nits own ;-)\n"},{"id":"191751","messageId":"CAH3AnrqM_T1kzHjtbZ5Vxz+jN6b-ZcxGUd5F=q23RXQLyQ2SYg@mail.gmail.com","threadId":"30564","inReplyTo":"4FB83BFC.4000702@web.de","subject":"Re: [PATCH 2/2] submodule: fix handling of supermodules with relative origin URLs","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2012-05-20T01:25:07Z","receivedAt":"2012-05-20T01:25:07Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On Sun, May 20, 2012 at 10:34 AM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n> Am 20.05.2012 00:51, schrieb Jon Seymour:\n>> On Sun, May 20, 2012 at 4:56 AM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n>>> Am 19.05.2012 06:40, schrieb Jon Seymour:\n>>>\n>>> Just a small nit: I'd prefer to replace the 4 occurrences of the term\n>>> \"supermodule\" with \"superproject\".\n>>\n>> Sure. I can't argue with precedent, of course, but I guess I was\n>> favouring the consistency in the suffixes used with sub and super.\n>\n> No big deal, but in recent posts \"superproject\" has been used and\n> the similarity between \"supermodule\" and \"submodule\" fooled me when\n> I read your RFC patch. So even though a superproject might be the a\n> submodule of another superproject, I'm all for using the term\n> \"superproject\" to make the distinction obvious.\n>\n>>> So no objection on the code changes from my side.\n>>\n>> I noticed one relative case that is not handled properly yet, but\n>> there is a workaround. If the superproject's origin URL is of the\n>> form: foo/bar (a case I actually have myself for reasons I can explain\n>> if you want me to), then the correct rule doesn't get matched by\n>> .*/*). The workaround is for the user to change foo/bar style origin\n>> URLs to ./foo/bar.\n>>\n>> Let me know if I should fix this case now too.\n>\n> Me thinks that this is subject for a subsequent patch. Having the\n> URL of the superproject *below* the root directory of the\n> superproject seems like a rather odd case which warrants a fix of\n> its own ;-)\n\nThe situation arises in my case because my working directory (which\nhas git controlled elements) contains a subdirectory called mnt with a\nsymbolic link called git which points to the actual location of my git\nrespositories. So, in this case:\n\n    mnt/git/public/work.git -> /var/git/public/work.git\n\nSo, if I want to set my origin to be my public git repositories, I naturally do:\n\n   git remote set-url origin mnt/git/public/work.git\n\nI'll wait to hear Junio's preference with regard to how I should split\nthe patches up before posting v3 that includes support for foo/bar in\naddition to ../foo/bar and ./foo/bar.\n\nRegards,\n\njon.\n"},{"id":"191753","messageId":"7v4nrbbfer.fsf@alter.siamese.dyndns.org","threadId":"30564","inReplyTo":"CAH3AnrrqiXqdHHGZPyOPJ3Zend5JrQX0rKV+pz_mjs3SDjv9DA@mail.gmail.com","subject":"Re: [PATCH 2/2] submodule: fix handling of supermodules with relative origin URLs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-05-20T05:16:44Z","receivedAt":"2012-05-20T05:16:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jon Seymour <jon.seymour@gmail.com> writes:\n\n> On Sun, May 20, 2012 at 4:56 AM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n>> Am 19.05.2012 06:40, schrieb Jon Seymour:\n>>\n>> Just a small nit: I'd prefer to replace the 4 occurrences of the term\n>> \"supermodule\" with \"superproject\".\n>\n> Sure. I can't argue with precedent, of course, but I guess I was\n> favouring the consistency in the suffixes used with sub and super.\n\nWe fairly consistently say (even outside the documentation---for example,\nlisten to the TechTalk Linus gave in May 2007) \"superproject\" and never\n\"supermodule\".  You can tell people who were not paying attention when\nthey say \"supermodule\" ;-).\n"},{"id":"191761","messageId":"4FB8F17A.9090308@web.de","threadId":"30564","inReplyTo":"7v4nrbbfer.fsf@alter.siamese.dyndns.org","subject":"[PATCH] Consistently use \"superproject\" instead of \"supermodule\"","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2012-05-20T13:28:26Z","receivedAt":"2012-05-20T13:28:26Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"We fairly consistently say \"superproject\" and never \"supermodule\" these\ndays. But there are seven occurrences of \"supermodule\" left in the current\nwork tree. Three appear in Release Notes for 1.5.3 and 1.7.7, three in\ntest names and one in a C-code comment.\n\nReplace all occurrences of \"supermodule\" outside of the Release Notes\n(which shouldn't be changed after the fact) with \"superproject\" for\nconsistency.\n\nSigned-off-by: Jens Lehmann <Jens.Lehmann@web.de>\n---\n\nAm 20.05.2012 07:16, schrieb Junio C Hamano:\n> Jon Seymour <jon.seymour@gmail.com> writes:\n> \n>> On Sun, May 20, 2012 at 4:56 AM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n>>> Am 19.05.2012 06:40, schrieb Jon Seymour:\n>>>\n>>> Just a small nit: I'd prefer to replace the 4 occurrences of the term\n>>> \"supermodule\" with \"superproject\".\n>>\n>> Sure. I can't argue with precedent, of course, but I guess I was\n>> favouring the consistency in the suffixes used with sub and super.\n> \n> We fairly consistently say (even outside the documentation---for example,\n> listen to the TechTalk Linus gave in May 2007) \"superproject\" and never\n> \"supermodule\".  You can tell people who were not paying attention when\n> they say \"supermodule\" ;-).\n\nOr they used one of the nine commit messages in current masters history\nor one the seven occurrences in the current work tree which use the term\n\"supermodule\" as inspiration ;-)\n\nWhile we can't change history and shouldn't change Release Notes, the\nother uses of \"supermodule\" should be removed.\n\n\n t/t7408-submodule-reference.sh | 4 ++--\n t/t9300-fast-import.sh         | 2 +-\n unpack-trees.c                 | 2 +-\n 3 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t7408-submodule-reference.sh b/t/t7408-submodule-reference.sh\nindex a45fadc..b770b2f 100755\n--- a/t/t7408-submodule-reference.sh\n+++ b/t/t7408-submodule-reference.sh\n@@ -28,7 +28,7 @@ git prune'\n\n cd \"$base_dir\"\n\n-test_expect_success 'preparing supermodule' \\\n+test_expect_success 'preparing superproject' \\\n 'test_create_repo super && cd super &&\n echo file > file &&\n git add file &&\n@@ -55,7 +55,7 @@ diff expected current'\n\n cd \"$base_dir\"\n\n-test_expect_success 'cloning supermodule' \\\n+test_expect_success 'cloning superproject' \\\n 'git clone super super-clone'\n\n cd \"$base_dir\"\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex 7da0e8d..2aa1824 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -1657,7 +1657,7 @@ M 160000 :6 sub\n INPUT_END\n\n test_expect_success \\\n-\t'P: supermodule & submodule mix' \\\n+\t'P: superproject & submodule mix' \\\n \t'git fast-import <input &&\n \t git checkout subuse1 &&\n \t rm -rf sub && mkdir sub && (cd sub &&\ndiff --git a/unpack-trees.c b/unpack-trees.c\nindex bcee99c..ad40109 100644\n--- a/unpack-trees.c\n+++ b/unpack-trees.c\n@@ -1210,7 +1210,7 @@ static int verify_uptodate_1(struct cache_entry *ce,\n \t\t\treturn 0;\n \t\t/*\n \t\t * NEEDSWORK: the current default policy is to allow\n-\t\t * submodule to be out of sync wrt the supermodule\n+\t\t * submodule to be out of sync wrt the superproject\n \t\t * index.  This needs to be tightened later for\n \t\t * submodules that are marked to be automatically\n \t\t * checked out.\n-- \n1.7.10.2.548.g9de9681.dirty\n"}]}