{"thread":{"id":"24393","subject":"serving git with both \"git:\" and \"http:\" and submodules","startedAt":"2010-07-14T15:29:51Z","lastAt":"2010-07-15T23:12:43Z","messageCount":12,"participants":["Boaz Harrosh","Jonathan Nieder","Peter Krefting","Johan Herland","Brad King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"145544","messageId":"4C3DD7EF.6010805@panasas.com","threadId":"24393","inReplyTo":null,"subject":"serving git with both \"git:\" and \"http:\" and submodules","fromName":"Boaz Harrosh","fromEmail":"bharrosh@panasas.com","sentAt":"2010-07-14T15:29:51Z","receivedAt":"2010-07-14T15:29:51Z","isPatch":false,"sender":{"key":"bharrosh@panasas.com","avatar":"https://gravatar.com/avatar/347e426f8ca0409f6891ceeefd4c3c2d8769608382323057efeaa362b4c3dbf3?d=mp&s=160"},"body":"\nI have a public tree that I maintain for users. The tree is consisted\nof a main-tree and a submodule tree which is also served from the same\nserver.\n\nThe main tree:\ngit://my-domain.org/my-tree/.git\nThe sub-tree:\ngit://my-domain.org/my-tree/sub/.git\n\nin my .gitmodule I have the usual\n[submodule \"sub\"]\n        url = git://my-domain.org/my-tree/sub/.git\n\nSo smart people using git will just do:\n1. $ git clone git://my-domain.org/my-tree/.git\n2. $ git submodule init\n3. $ git submodule update\n\nAnd all is well... But smart ass corporate people would not use \"git:\"\nprotocol because of fire-walls and for them I have a dumb \"http:\" export\nas:\n1. $ git clone http://my-domain.org/trees/my-tree/.git\n\nWith them, step 3 above will not work. My current instructions\nfor them is that after the step 2 \"git submodule init\" they should\nmanually edit my-tree/.git/config and change to:\n[submodule \"sub\"]\n-        url = git://my-domain.org/my-tree/sub/.git\n+        url = http://my-domain.org/trees/my-tree/sub/.git\n\nAnd then do step 3 to clone the sub-module.\n\nSo my question is: Can I automate this so people with \"http:\"\nclones are not forced to manually edit their config files?\n(Some users are just not up to it)\n\nThanks, (Sorry if that has been raised before. Couldn't find any.)\nBoaz\n"},{"id":"145546","messageId":"20100714153900.GB1583@burratino","threadId":"24393","inReplyTo":"4C3DD7EF.6010805@panasas.com","subject":"Re: serving git with both \"git:\" and \"http:\" and submodules","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-14T15:39:00Z","receivedAt":"2010-07-14T15:39:00Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Boaz Harrosh wrote:\n\n> So smart people using git will just do:\n> 1. $ git clone git://my-domain.org/my-tree/.git\n> 2. $ git submodule init\n> 3. $ git submodule update\n> \n> And all is well... But smart ass corporate people would not use \"git:\"\n> protocol because of fire-walls and for them I have a dumb \"http:\" export\n> as:\n> 1. $ git clone http://my-domain.org/trees/my-tree/.git\n[...]\n> So my question is: Can I automate this so people with \"http:\"\n> clones are not forced to manually edit their config files?\n> (Some users are just not up to it)\n\nSure.  For example, you can ship an update-submodules.sh script\nto take care of checking “git config remote.origin.url” and\nupdating the ‘[submodule \"sub\"] url’ configuration to match.\n\nOf course, even this would not make\n'git clone --recursive http://my-domain.org/trees/my-tree/.git'\nwork.  If you can get git-http-backend working, I’d suggest using\nthat so you only have to deal with one url.\n\nHope that helps,\nJonathan\n"},{"id":"145548","messageId":"4C3DDEBA.8010509@panasas.com","threadId":"24393","inReplyTo":"20100714153900.GB1583@burratino","subject":"Re: serving git with both \"git:\" and \"http:\" and submodules","fromName":"Boaz Harrosh","fromEmail":"bharrosh@panasas.com","sentAt":"2010-07-14T15:58:50Z","receivedAt":"2010-07-14T15:58:50Z","isPatch":false,"sender":{"key":"bharrosh@panasas.com","avatar":"https://gravatar.com/avatar/347e426f8ca0409f6891ceeefd4c3c2d8769608382323057efeaa362b4c3dbf3?d=mp&s=160"},"body":"On 07/14/2010 06:39 PM, Jonathan Nieder wrote:\n> Boaz Harrosh wrote:\n> \n>> So smart people using git will just do:\n>> 1. $ git clone git://my-domain.org/my-tree/.git\n>> 2. $ git submodule init\n>> 3. $ git submodule update\n>>\n>> And all is well... But smart ass corporate people would not use \"git:\"\n>> protocol because of fire-walls and for them I have a dumb \"http:\" export\n>> as:\n>> 1. $ git clone http://my-domain.org/trees/my-tree/.git\n> [...]\n>> So my question is: Can I automate this so people with \"http:\"\n>> clones are not forced to manually edit their config files?\n>> (Some users are just not up to it)\n> \n> Sure.  For example, you can ship an update-submodules.sh script\n> to take care of checking “git config remote.origin.url” and\n> updating the ‘[submodule \"sub\"] url’ configuration to match.\n> \n> Of course, even this would not make\n> 'git clone --recursive http://my-domain.org/trees/my-tree/.git'\n\nRight\n\n> work.  If you can get git-http-backend working, I’d suggest using\n> that so you only have to deal with one url.\n> \n\nOk I'll dive into \"git-http-backend\" (any pointers). But I thought\nthis one will still serve me an \"http:\" url. Are you suggesting to\njust drop the \"git:\" protocol? (Since \"git-http-backend\" is just as\ngood, through http?)\n\n> Hope that helps,\n> Jonathan\n\nBut a script for users might be a very good idea. I might even add\nit to the main Makefile. And make it totally transparent.\n$ git-clone; make;\n\nThanks that actually helped\nBoaz\n"},{"id":"145552","messageId":"20100714161254.GA2265@burratino","threadId":"24393","inReplyTo":"4C3DDEBA.8010509@panasas.com","subject":"Re: serving git with both \"git:\" and \"http:\" and submodules","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-14T16:12:54Z","receivedAt":"2010-07-14T16:12:54Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Boaz Harrosh wrote:\n\n> Ok I'll dive into \"git-http-backend\" (any pointers).\n\nThe reference manual[1] is all I know of.  Googling reveals a\nnice overview[2] by Scott Chacon.\n\n>                                              Are you suggesting to\n> just drop the \"git:\" protocol? (Since \"git-http-backend\" is just as\n> good, through http?)\n\nExactly[3].\n\n> Thanks that actually helped\n\nGlad to be useful. :)\n\nGood luck,\nJonathan\n\n[1] http://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html\n[2] http://progit.org/2010/03/04/smart-http.html\n[3] Well, the protocol overhead is a little higher, but that is nothing\ncompared to the difference between git: and traditional static http:.\n"},{"id":"145594","messageId":"alpine.DEB.2.00.1007150745340.13735@perkele.intern.softwolves.pp.se","threadId":"24393","inReplyTo":"4C3DD7EF.6010805@panasas.com","subject":"Re: serving git with both \"git:\" and \"http:\" and submodules","fromName":"Peter Krefting","fromEmail":"peter@softwolves.pp.se","sentAt":"2010-07-15T06:46:25Z","receivedAt":"2010-07-15T06:46:25Z","isPatch":false,"sender":{"key":"peter@softwolves.pp.se","avatar":"https://avatars.githubusercontent.com/u/990764?v=4"},"body":"Boaz Harrosh:\n\n> [submodule \"sub\"]\n>        url = git://my-domain.org/my-tree/sub/.git\n\n> So my question is: Can I automate this so people with \"http:\" clones are \n> not forced to manually edit their config files?\n\nYou should be able to use a relative URL in .gitmodules, something like this \nshould work:\n\n[submodule \"sub\"]\n        url = ../sub/.git\n\n-- \n\\\\// Peter - http://www.softwolves.pp.se/\n"},{"id":"145607","messageId":"20100715074155.GA22244@burratino","threadId":"24393","inReplyTo":"alpine.DEB.2.00.1007150745340.13735@perkele.intern.softwolves.pp.se","subject":"[PATCH] gitmodules.5: url can be a relative path","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-15T07:41:55Z","receivedAt":"2010-07-15T07:41:55Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"There is already excellent documentation for this facility in\ngit-submodule.1, but it is not so discoverable.\n\nRelative paths in .gitmodules can be useful for serving the\nsame repository over multiple protocols, for example.\nThanks to Peter for pointing this out.\n\nCc: Peter Krefting <peter@softwolves.pp.se>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n Documentation/gitmodules.txt |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/gitmodules.txt b/Documentation/gitmodules.txt\nindex 5daf750..72a13d1 100644\n--- a/Documentation/gitmodules.txt\n+++ b/Documentation/gitmodules.txt\n@@ -29,6 +29,9 @@ submodule.<name>.path::\n \n submodule.<name>.url::\n \tDefines an url from where the submodule repository can be cloned.\n+\tThis may be either an absolute URL ready to be passed to\n+\tlinkgit:git-clone[1] or (if it begins with ./ or ../) a location\n+\trelative to the superproject's origin repository.\n \n submodule.<name>.update::\n \tDefines what to do when the submodule is updated by the superproject.\n-- \n1.7.2.rc2\n"},{"id":"145608","messageId":"20100715075119.GB22244@burratino","threadId":"24393","inReplyTo":"20100715074155.GA22244@burratino","subject":"[PATCH] Documentation: add submodule.* to the big configuration variable list","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-15T07:51:19Z","receivedAt":"2010-07-15T07:51:19Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"The url, path, and update items in [submodule \"foo\"] stanzas are\nnicely explained in the .gitmodules and ‘git submodule’\ndocumentation.  Point there from the config documentation.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nIt’s late, so I don’t trust this to be coherent English necessarily.\nThoughts and improvements welcome.\n\n Documentation/config.txt |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 1029bc4..f1fb5ac 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1685,6 +1685,15 @@ status.submodulesummary::\n \tsummary of commits for modified submodules will be shown (see\n \t--summary-limit option of linkgit:git-submodule[1]).\n \n+submodule.<name>.path::\n+submodule.<name>.url::\n+submodule.<name>.update::\n+\tThe path within this project, URL, and updating strategy\n+\tfor a submodule.  These variables are initially populated\n+\tby 'git submodule init'; edit them to override the\n+\tURL and other values found in the `.gitmodules` file.  See\n+\tlinkgit:git-submodule[1] and linkgit:gitmodules[5] for details.\n+\n tar.umask::\n \tThis variable can be used to restrict the permission bits of\n \ttar archive entries.  The default is 0002, which turns off the\n-- \n1.7.2.rc2\n"},{"id":"145614","messageId":"201007151132.40617.johan@herland.net","threadId":"24393","inReplyTo":"20100715074155.GA22244@burratino","subject":"Re: [PATCH] gitmodules.5: url can be a relative path","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2010-07-15T09:32:40Z","receivedAt":"2010-07-15T09:32:40Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Thursday 15 July 2010, Jonathan Nieder wrote:\n> There is already excellent documentation for this facility in\n> git-submodule.1, but it is not so discoverable.\n> \n> Relative paths in .gitmodules can be useful for serving the\n> same repository over multiple protocols, for example.\n> Thanks to Peter for pointing this out.\n> \n> Cc: Peter Krefting <peter@softwolves.pp.se>\n> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>\n\nAcked-by: Johan Herland <johan@herland.net>\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"145615","messageId":"201007151134.56090.johan@herland.net","threadId":"24393","inReplyTo":"20100715075119.GB22244@burratino","subject":"Re: [PATCH] Documentation: add submodule.* to the big configuration variable list","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2010-07-15T09:34:55Z","receivedAt":"2010-07-15T09:34:55Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Thursday 15 July 2010, Jonathan Nieder wrote:\n> The url, path, and update items in [submodule \"foo\"] stanzas are\n> nicely explained in the .gitmodules and ‘git submodule’\n> documentation.  Point there from the config documentation.\n> \n> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>\n\nAcked-by: Johan Herland <johan@herland.net>\n\n> ---\n> It’s late, so I don’t trust this to be coherent English necessarily.\n> Thoughts and improvements welcome.\n> \n>  Documentation/config.txt |    9 +++++++++\n>  1 files changed, 9 insertions(+), 0 deletions(-)\n> \n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index 1029bc4..f1fb5ac 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -1685,6 +1685,15 @@ status.submodulesummary::\n>  \tsummary of commits for modified submodules will be shown (see\n>  \t--summary-limit option of linkgit:git-submodule[1]).\n> \n> +submodule.<name>.path::\n> +submodule.<name>.url::\n> +submodule.<name>.update::\n> +\tThe path within this project, URL, and updating strategy\n\nMay be more legible with:\n\n  The path within this project, the URL, and the updating strategy...\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"145616","messageId":"4C3EDF38.4060003@panasas.com","threadId":"24393","inReplyTo":"20100715074155.GA22244@burratino","subject":"Re: [PATCH] gitmodules.5: url can be a relative path","fromName":"Boaz Harrosh","fromEmail":"bharrosh@panasas.com","sentAt":"2010-07-15T10:13:12Z","receivedAt":"2010-07-15T10:13:12Z","isPatch":true,"sender":{"key":"bharrosh@panasas.com","avatar":"https://gravatar.com/avatar/347e426f8ca0409f6891ceeefd4c3c2d8769608382323057efeaa362b4c3dbf3?d=mp&s=160"},"body":"On 07/15/2010 10:41 AM, Jonathan Nieder wrote:\n> There is already excellent documentation for this facility in\n> git-submodule.1, but it is not so discoverable.\n> \n> Relative paths in .gitmodules can be useful for serving the\n> same repository over multiple protocols, for example.\n> Thanks to Peter for pointing this out.\n> \n\nYou guys rock. It's exactly what the doctor ordered\n\nThanks\nBoaz\n"},{"id":"145625","messageId":"4C3F1617.7020706@kitware.com","threadId":"24393","inReplyTo":"20100714153900.GB1583@burratino","subject":"Re: serving git with both \"git:\" and \"http:\" and submodules","fromName":"Brad King","fromEmail":"brad.king@kitware.com","sentAt":"2010-07-15T14:07:19Z","receivedAt":"2010-07-15T14:07:19Z","isPatch":false,"sender":{"key":"brad.king@kitware.com","avatar":"https://avatars.githubusercontent.com/u/87268?v=4"},"body":"On 07/14/2010 11:39 AM, Jonathan Nieder wrote:\n> Boaz Harrosh wrote:\n>> So my question is: Can I automate this so people with \"http:\"\n>> clones are not forced to manually edit their config files?\n\nAlmost.\n\n> Of course, even this would not make\n> 'git clone --recursive http://my-domain.org/trees/my-tree/.git'\n> work.\n\nFirewall-ed users can just run\n\n$ git config --global url.http://my-domain.org/.insteadOf git://my-domain.org/\n\n*once* per user per machine, or even\n\n$ git config --global url.http.insteadOf git\n\nif they want to be really aggressive.  After that they can just\npretend to use the git protocol and all URLs will be mapped under\nthe hood:\n\n  git clone --recursive git://my-domain.org/...\n\n-Brad\n"},{"id":"145670","messageId":"20100715231243.GA8270@burratino","threadId":"24393","inReplyTo":"201007151134.56090.johan@herland.net","subject":"Re: [PATCH] Documentation: add submodule.* to the big configuration variable list","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-15T23:12:43Z","receivedAt":"2010-07-15T23:12:43Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Johan Herland wrote:\n\n> May be more legible with:\n> \n>   The path within this project, the URL, and the updating strategy...\n\nThanks, Johan.  I’ve pushed both patches out to\n  git://repo.or.cz/git/jrn.git submodule-doc\nincluding that change.\n\nJonathan Nieder (2):\n      gitmodules.5: url can be a relative path\n      Documentation: add submodule.* to the big configuration variable list\n\n Documentation/config.txt     |    9 +++++++++\n Documentation/gitmodules.txt |    3 +++\n 2 files changed, 12 insertions(+), 0 deletions(-)\n"}]}