{"thread":{"id":"9027","subject":"question about git-submodule","startedAt":"2007-07-13T21:46:30Z","lastAt":"2007-08-06T17:23:19Z","messageCount":22,"participants":["VMiklos","Sven Verdoolaege","Alex Riesen","Eran Tromer"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"47288","messageId":"20070713214630.GB7106@genesis.frugalware.org","threadId":"9027","inReplyTo":null,"subject":"question about git-submodule","fromName":"VMiklos","fromEmail":"vmiklos@frugalware.org","sentAt":"2007-07-13T21:46:30Z","receivedAt":"2007-07-13T21:46:30Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"hi,\n\neven after reading the manpage, i'm not sure about what git submodules\nare for :)\n\ni mean, first i thought that after configuring a submodule under libfoo,\nthen a git pull will update libfoo's repo under libfoo, too. or\nsomething like that. but in fact even after reasing the source, i'm not\nsure about what is git submodule update is for :s\n\nsorry for the lame question :)\n\nthanks,\n- VMiklos\n"},{"id":"47405","messageId":"20070715083959.GC999MdfPADPa@greensroom.kotnet.org","threadId":"9027","inReplyTo":"20070713214630.GB7106@genesis.frugalware.org","subject":"Re: question about git-submodule","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2007-07-15T08:39:59Z","receivedAt":"2007-07-15T08:39:59Z","isPatch":false,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Fri, Jul 13, 2007 at 11:46:30PM +0200, VMiklos wrote:\n> i mean, first i thought that after configuring a submodule under libfoo,\n> then a git pull will update libfoo's repo under libfoo, too. or\n> something like that.\n\nUnless I've missed something, it doesn't.\nSome of use would like git to do just that (at least Alex Riesen,\nMartin Waitz and myself have sent in patches to that effect),\nbut we haven't been able to convince Junio yet.\n\nskimo\n"},{"id":"47412","messageId":"20070715104712.GF2568@steel.home","threadId":"9027","inReplyTo":"20070715083959.GC999MdfPADPa@greensroom.kotnet.org","subject":"Re: question about git-submodule","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-15T10:47:12Z","receivedAt":"2007-07-15T10:47:12Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Sven Verdoolaege, Sun, Jul 15, 2007 10:39:59 +0200:\n> On Fri, Jul 13, 2007 at 11:46:30PM +0200, VMiklos wrote:\n> > i mean, first i thought that after configuring a submodule under libfoo,\n> > then a git pull will update libfoo's repo under libfoo, too. or\n> > something like that.\n> \n> Unless I've missed something, it doesn't.\n> Some of use would like git to do just that (at least Alex Riesen,\n> Martin Waitz and myself have sent in patches to that effect),\n> but we haven't been able to convince Junio yet.\n\nCount me out. Junio convinced me instead and having tried the\nsubprojects I find it really convenient: I can choose when and what\nshould be updated and I can see what _can_ be updated, iff I decide\nto. Subprojects defined in such a loosely way are more flexible then\nhaving git-pull fetch subprojects by default. Sometimes I even want be\n_sure_ the subprojects are completely untouched (I have some critical\nparts in them).\n"},{"id":"47414","messageId":"20070715105450.GD7106@genesis.frugalware.org","threadId":"9027","inReplyTo":"20070715104712.GF2568@steel.home","subject":"Re: question about git-submodule","fromName":"VMiklos","fromEmail":"vmiklos@frugalware.org","sentAt":"2007-07-15T10:54:50Z","receivedAt":"2007-07-15T10:54:50Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Hello,\n\nNa Sun, Jul 15, 2007 at 12:47:12PM +0200, Alex Riesen <raa.lkml@gmail.com> pisal(a):\n> to. Subprojects defined in such a loosely way are more flexible then\n> having git-pull fetch subprojects by default. Sometimes I even want be\n> _sure_ the subprojects are completely untouched (I have some critical\n> parts in them).\n\nOkay, but where can you overwrite that default? It would be nice to have\na config variable for this or something like that.\n\nthanks,\n- VMiklos\n"},{"id":"47417","messageId":"20070715115148.GD999MdfPADPa@greensroom.kotnet.org","threadId":"9027","inReplyTo":"20070715104712.GF2568@steel.home","subject":"Re: question about git-submodule","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2007-07-15T11:51:48Z","receivedAt":"2007-07-15T11:51:48Z","isPatch":false,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Sun, Jul 15, 2007 at 12:47:12PM +0200, Alex Riesen wrote:\n> Count me out. Junio convinced me instead and having tried the\n> subprojects I find it really convenient: I can choose when and what\n> should be updated and I can see what _can_ be updated, iff I decide\n> to. Subprojects defined in such a loosely way are more flexible then\n> having git-pull fetch subprojects by default.\n\nI agree that fetching should probably be left as a separate operation,\nbut if you have all the data, then I find it very inconvenient that\nevery time you switch to a different commit you have to update\nall the subprojects separately too.\nDid you change your mind about this part too?\n\n> Sometimes I even want be\n> _sure_ the subprojects are completely untouched (I have some critical\n> parts in them).\n\nThe update in the superproject would fail if the subproject is dirty\n(just as with files.)\n\nskimo\n"},{"id":"47423","messageId":"20070715134212.GH2568@steel.home","threadId":"9027","inReplyTo":"20070715115148.GD999MdfPADPa@greensroom.kotnet.org","subject":"Re: question about git-submodule","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-15T13:42:12Z","receivedAt":"2007-07-15T13:42:12Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Sven Verdoolaege, Sun, Jul 15, 2007 13:51:48 +0200:\n> On Sun, Jul 15, 2007 at 12:47:12PM +0200, Alex Riesen wrote:\n> > Count me out. Junio convinced me instead and having tried the\n> > subprojects I find it really convenient: I can choose when and what\n> > should be updated and I can see what _can_ be updated, iff I decide\n> > to. Subprojects defined in such a loosely way are more flexible then\n> > having git-pull fetch subprojects by default.\n> \n> I agree that fetching should probably be left as a separate operation,\n> but if you have all the data, then I find it very inconvenient that\n> every time you switch to a different commit you have to update\n> all the subprojects separately too.\n\nI found I do _not_ need to do it every time I switch to a different\ncommit.\n\n> Did you change your mind about this part too?\n\nYep. I have less to transfer (and in fact, the subproject I mentioned\nis kind of heavy and has a lot of binary stuff in it).\n\n> > Sometimes I even want be\n> > _sure_ the subprojects are completely untouched (I have some critical\n> > parts in them).\n> \n> The update in the superproject would fail if the subproject is dirty\n> (just as with files.)\n\nHaven't noticed this yet. Merge ignores subprojects. What do you mean?\n"},{"id":"47424","messageId":"20070715135057.GI2568@steel.home","threadId":"9027","inReplyTo":"20070715105450.GD7106@genesis.frugalware.org","subject":"Re: question about git-submodule","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-15T13:50:57Z","receivedAt":"2007-07-15T13:50:57Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"VMiklos, Sun, Jul 15, 2007 12:54:50 +0200:\n> Na Sun, Jul 15, 2007 at 12:47:12PM +0200, Alex Riesen <raa.lkml@gmail.com> pisal(a):\n> > to. Subprojects defined in such a loosely way are more flexible then\n> > having git-pull fetch subprojects by default. Sometimes I even want be\n> > _sure_ the subprojects are completely untouched (I have some critical\n> > parts in them).\n> \n> Okay, but where can you overwrite that default? It would be nice to have\n> a config variable for this or something like that.\n\nIt is not a default in a sense where it control the behaviour of a git\ncommand. git pull just does not do anything to subprojects and you use\na separate command (git-submodule update, I believe) to update them.\n\nThat said, I never used the git-submodule, nor did I have an urge to.\nAs I said, I find it convenient enough as it is with git-add and\ngit-diff, checking out the subproject as needed. Have to be careful\nabout \"git commit -a\" (which I almost never use anyway) and haven't\nhad conflicts yet.\n"},{"id":"47425","messageId":"20070715135218.GE999MdfPADPa@greensroom.kotnet.org","threadId":"9027","inReplyTo":"20070715134212.GH2568@steel.home","subject":"Re: question about git-submodule","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2007-07-15T13:52:18Z","receivedAt":"2007-07-15T13:52:18Z","isPatch":false,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Sun, Jul 15, 2007 at 03:42:12PM +0200, Alex Riesen wrote:\n> Sven Verdoolaege, Sun, Jul 15, 2007 13:51:48 +0200:\n> > I agree that fetching should probably be left as a separate operation,\n> > but if you have all the data, then I find it very inconvenient that\n> > every time you switch to a different commit you have to update\n> > all the subprojects separately too.\n> \n> I found I do _not_ need to do it every time I switch to a different\n> commit.\n\nOk.  Then I guess we have different needs and I should only\ndo it if some config option is set if I ever try to resend\nthe patch.\n\n> > The update in the superproject would fail if the subproject is dirty\n> > (just as with files.)\n> \n> Haven't noticed this yet. Merge ignores subprojects. What do you mean?\n> \n\nI mean that if such a feature would be implemented, then it wouldn't\ngo ahead with the update if some of the subprojects couldn't be updated.\n\nskimo\n"},{"id":"47426","messageId":"20070715135453.GE7106@genesis.frugalware.org","threadId":"9027","inReplyTo":"20070715135057.GI2568@steel.home","subject":"Re: question about git-submodule","fromName":"VMiklos","fromEmail":"vmiklos@frugalware.org","sentAt":"2007-07-15T13:54:53Z","receivedAt":"2007-07-15T13:54:53Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Hello,\n\nNa Sun, Jul 15, 2007 at 03:50:57PM +0200, Alex Riesen <raa.lkml@gmail.com> pisal(a):\n> It is not a default in a sense where it control the behaviour of a git\n> command. git pull just does not do anything to subprojects and you use\n> a separate command (git-submodule update, I believe) to update them.\n> \n> That said, I never used the git-submodule, nor did I have an urge to.\n\nthat's what i asked originally :) i believed that one is supposed to use\ngit-submodule update to pull each submodule, but it does not seems to\ndo so. my question is still about if it is possible to pull each\nsubmodule using a single command\n\nthanks,\n- VMiklos\n"},{"id":"47428","messageId":"20070715140244.GF999MdfPADPa@greensroom.kotnet.org","threadId":"9027","inReplyTo":"20070715135453.GE7106@genesis.frugalware.org","subject":"Re: question about git-submodule","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2007-07-15T14:02:44Z","receivedAt":"2007-07-15T14:02:44Z","isPatch":false,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Sun, Jul 15, 2007 at 03:54:53PM +0200, VMiklos wrote:\n> that's what i asked originally :) i believed that one is supposed to use\n> git-submodule update to pull each submodule, but it does not seems to\n> do so. my question is still about if it is possible to pull each\n> submodule using a single command\n\nMaybe you should explain in a bit more detail what you are trying\nto do.\n\nskimo\n"},{"id":"47431","messageId":"20070715142624.GF7106@genesis.frugalware.org","threadId":"9027","inReplyTo":"20070715140244.GF999MdfPADPa@greensroom.kotnet.org","subject":"Re: question about git-submodule","fromName":"VMiklos","fromEmail":"vmiklos@frugalware.org","sentAt":"2007-07-15T14:26:24Z","receivedAt":"2007-07-15T14:26:24Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Hello,\n\nNa Sun, Jul 15, 2007 at 04:02:44PM +0200, Sven Verdoolaege <skimo@kotnet.org> pisal(a):\n> On Sun, Jul 15, 2007 at 03:54:53PM +0200, VMiklos wrote:\n> > that's what i asked originally :) i believed that one is supposed to use\n> > git-submodule update to pull each submodule, but it does not seems to\n> > do so. my question is still about if it is possible to pull each\n> > submodule using a single command\n> \n> Maybe you should explain in a bit more detail what you are trying\n> to do.\n\nok :) so i have a repo and i add a submodule in the libfoo dir. when i\nadd it, git will clone the repo, that's fine. it would be nice to have a\ncommand (i thought git submodule update would do it for me) which would\npull in the repo _and_ would pull in the libfoo dir, too\n\ncurrently if you have 10 submodules, you need to updated each of them\nmanually, and having a feature to all of them at once would be nice (of\ncourse it's fine if this is not the default when using git pull in the\n\"main\" repo)\n\nthanks,\n- VMiklos\n"},{"id":"47433","messageId":"20070715144835.GI999MdfPADPa@greensroom.kotnet.org","threadId":"9027","inReplyTo":"20070715142624.GF7106@genesis.frugalware.org","subject":"Re: question about git-submodule","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2007-07-15T14:48:35Z","receivedAt":"2007-07-15T14:48:35Z","isPatch":false,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Sun, Jul 15, 2007 at 04:26:24PM +0200, VMiklos wrote:\n> currently if you have 10 submodules, you need to updated each of them\n> manually, and having a feature to all of them at once would be nice (of\n> course it's fine if this is not the default when using git pull in the\n> \"main\" repo)\n\nIsn't that what \"git submodule update\" does ?\n\nskimo\n"},{"id":"47435","messageId":"20070715150540.GH7106@genesis.frugalware.org","threadId":"9027","inReplyTo":"20070715144835.GI999MdfPADPa@greensroom.kotnet.org","subject":"Re: question about git-submodule","fromName":"VMiklos","fromEmail":"vmiklos@frugalware.org","sentAt":"2007-07-15T15:05:40Z","receivedAt":"2007-07-15T15:05:40Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Hello,\n\nNa Sun, Jul 15, 2007 at 04:48:35PM +0200, Sven Verdoolaege <skimo@kotnet.org> pisal(a):\n> Isn't that what \"git submodule update\" does ?\n\ni can't get it to work, but here is a log:\n\nhttp://frugalware.org/~vmiklos/logs/git-submodule.log\n\nat the end of it, git submodule update does not pull anything, while\nthere are changes both in the main and in the libfoo repo, too\n\nhave i missed something?\n\nthanks,\n- VMiklos\n"},{"id":"47437","messageId":"20070715152101.GJ999MdfPADPa@greensroom.kotnet.org","threadId":"9027","inReplyTo":"20070715150540.GH7106@genesis.frugalware.org","subject":"Re: question about git-submodule","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2007-07-15T15:21:01Z","receivedAt":"2007-07-15T15:21:01Z","isPatch":false,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Sun, Jul 15, 2007 at 05:05:40PM +0200, VMiklos wrote:\n> Hello,\n> \n> Na Sun, Jul 15, 2007 at 04:48:35PM +0200, Sven Verdoolaege <skimo@kotnet.org> pisal(a):\n> > Isn't that what \"git submodule update\" does ?\n> \n> i can't get it to work, but here is a log:\n> \n\n> vmiklos@vmobile:~/git/test$ ls\n> vmiklos@vmobile:~/git/test$ mkdir server\n> vmiklos@vmobile:~/git/test$ cd server\n> vmiklos@vmobile:~/git/test/server$ mkdir main\n> vmiklos@vmobile:~/git/test/server$ cd main\n> vmiklos@vmobile:~/git/test/server/main$ git init\n> Initialized empty Git repository in .git/\n> vmiklos@vmobile:~/git/test/server/main$ echo \"foo\" > main.c\n> vmiklos@vmobile:~/git/test/server/main$ git add main.c\n> vmiklos@vmobile:~/git/test/server/main$ git commit -m \"import main\"\n> Created initial commit 1ceae8f: import main\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n>  create mode 100644 main.c\n> vmiklos@vmobile:~/git/test/server/main$ cd ..\n> vmiklos@vmobile:~/git/test/server$ mkdir libfoo\n> vmiklos@vmobile:~/git/test/server$ cd libfoo\n> vmiklos@vmobile:~/git/test/server/libfoo$ git init\n> Initialized empty Git repository in .git/\n> vmiklos@vmobile:~/git/test/server/libfoo$ echo \"foo\" > libfoo.c\n> vmiklos@vmobile:~/git/test/server/libfoo$ git add libfoo.c\n> vmiklos@vmobile:~/git/test/server/libfoo$ git commit -m \"import libfoo\"\n> Created initial commit 5979d36: import libfoo\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n>  create mode 100644 libfoo.c\n> vmiklos@vmobile:~/git/test/server/libfoo$ cd ../..\n> vmiklos@vmobile:~/git/test$ mkdir client\n> vmiklos@vmobile:~/git/test$ cd client\n> vmiklos@vmobile:~/git/test/client$ git clone ../server/main\n> Initialized empty Git repository in /home/vmiklos/git/test/client/main/.git/\n> remote: Generating pack...\n> Done counting 3 objects.\n> Deltifying 3 objects...\n>  100% (3/3) done\n> Total 3 remote: (delta 0), reused 0 (delta 0)\n> Indexing 3 objects...\n>  100% (3/3) done\n> \n> vmiklos@vmobile:~/git/test/client$ cd main\n> vmiklos@vmobile:~/git/test/client/main$ ls\n> main.c\n> vmiklos@vmobile:~/git/test/client/main$ git submodule add ../../server/libfoo/ libfoo\n\nHere you add a submodule in the copy of the superproject in client.\n\n> Initialized empty Git repository in /home/vmiklos/git/test/client/main/libfoo/.git/\n> remote: Generating pack...\n> remote: Done counting 3 objects.\n> remote: Deltifying 3 objects...\n>  100% (3/3) done\n> Total 3 (delta 0), reused 0 (delta 0)\n> Indexing 3 objects...\n>  100% (3/3) done\n> \n> vmiklos@vmobile:~/git/test/client/main$ git submodule init\n> Submodule 'libfoo' (/home/vmiklos/git/test/server/libfoo/.git) registered for path 'libfoo'\n> vmiklos@vmobile:~/git/test/client/main$ git commit -a -m \"registered libfoo submodule\"\n> Created commit 2c65310: registered libfoo submodule\n>  2 files changed, 4 insertions(+), 0 deletions(-)\n>  create mode 100644 .gitmodules\n>  create mode 160000 libfoo\n> vmiklos@vmobile:~/git/test/client/main$ cd ../../server/main\n> vmiklos@vmobile:~/git/test/server/main$ echo bar >> main.c\n> vmiklos@vmobile:~/git/test/server/main$ git add git commit -m \"bar in main\"\n> vmiklos@vmobile:~/git/test/server/main$ git add main.c\n> vmiklos@vmobile:~/git/test/server/main$ git commit -m \"bar in main\"\n> Created commit 1c26399: bar in main\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n> vmiklos@vmobile:~/git/test/server/main$ cd ../libfoo\n> vmiklos@vmobile:~/git/test/server/libfoo$ echo bar >> libfoo.c\n> vmiklos@vmobile:~/git/test/server/libfoo$ git add libfoo.c\n> vmiklos@vmobile:~/git/test/server/libfoo$ git commit -m \"bar in libfoo\"\n> Created commit 07ceadb: bar in libfoo\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n> vmiklos@vmobile:~/git/test/server/libfoo$ cd ../../client/main\n> vmiklos@vmobile:~/git/test/client/main$ git submodule update\n> \n> at the end of it, git submodule update does not pull anything, while\n> there are changes both in the main and in the libfoo repo, too\n\nThe last time you told the superproject about any changes\nin the subprojects was when you added the subproject (in client),\nso as far as the superproject is concerned nothing happened\nin any submodule.  The submodules don't even exist in server.\n\nskimo\n"},{"id":"47438","messageId":"20070715154028.GI7106@genesis.frugalware.org","threadId":"9027","inReplyTo":"20070715152101.GJ999MdfPADPa@greensroom.kotnet.org","subject":"Re: question about git-submodule","fromName":"VMiklos","fromEmail":"vmiklos@frugalware.org","sentAt":"2007-07-15T15:40:28Z","receivedAt":"2007-07-15T15:40:28Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Hello,\n\nNa Sun, Jul 15, 2007 at 05:21:01PM +0200, Sven Verdoolaege <skimo@kotnet.org> pisal(a):\n> > vmiklos@vmobile:~/git/test/client/main$ git submodule add ../../server/libfoo/ libfoo\n> \n> Here you add a submodule in the copy of the superproject in client.\n\ncorrect\n\n> > vmiklos@vmobile:~/git/test/client/main$ git submodule update\n> > \n> > at the end of it, git submodule update does not pull anything, while\n> > there are changes both in the main and in the libfoo repo, too\n> \n> The last time you told the superproject about any changes\n> in the subprojects was when you added the subproject (in client),\n> so as far as the superproject is concerned nothing happened\n> in any submodule.  The submodules don't even exist in server.\n\nokay, let me continue the example, then:\n\nvmiklos@vmobile:~/git/test/client2$ git clone ../client/main\nInitialized empty Git repository in /home/vmiklos/git/test/client2/main/.git/\nremote: Generating pack...\nremote: Done counting 11 objects.\nremote: Deltifying 11 objects...\nremote:  100% (11/11) done\nIndexing 11 objects...\n 100% (11/11) done\nResolving 2 deltas...\n 100% (2/2) done\nremote: Total 11 (delta 2), reused 3 (delta 0)\nvmiklos@vmobile:~/git/test/client2$ ls\nmain/\nvmiklos@vmobile:~/git/test/client2$ cd ../client/main/\nvmiklos@vmobile:~/git/test/client/main$ git pull\nAlready up-to-date.\nvmiklos@vmobile:~/git/test/client/main$ cd libfoo\nvmiklos@vmobile:~/git/test/client/main/libfoo$ git pull\nremote: Generating pack...\nremote: Done counting 5 objects.\nResult has 3 objects.\nremote: Deltifying 3 objects...\n 100% (3/3) done\nTotal 3 (delta 0), reused 0 (delta remote: 0)\nUnpacking 3 objects...\n 100% (3/3) done\n* refs/remotes/origin/master: fast forward to branch 'master' of /home/vmiklos/git/test/server/libfoo/\n  old..new: 5979d36..07ceadb\nUpdating 5979d36..07ceadb\nFast forward\n libfoo.c |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\nvmiklos@vmobile:~/git/test/client/main/libfoo$ cd ../../../client2/main\nvmiklos@vmobile:~/git/test/client2/main$ git submodule update\n\nso the submodule exists now on the server and there would be something,\nto update in the submodule, but git submodule update seem not to do\nanything\n\nthanks,\n- VMiklos\n"},{"id":"47461","messageId":"20070715214530.GK999MdfPADPa@greensroom.kotnet.org","threadId":"9027","inReplyTo":"20070715154028.GI7106@genesis.frugalware.org","subject":"Re: question about git-submodule","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2007-07-15T21:45:30Z","receivedAt":"2007-07-15T21:45:30Z","isPatch":false,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Sun, Jul 15, 2007 at 05:40:28PM +0200, VMiklos wrote:\n> vmiklos@vmobile:~/git/test/client2/main$ git submodule update\n\nYou should do a git submodule init first.\n\nskimo\n"},{"id":"47465","messageId":"20070715222948.GL7106@genesis.frugalware.org","threadId":"9027","inReplyTo":"20070715214530.GK999MdfPADPa@greensroom.kotnet.org","subject":"Re: question about git-submodule","fromName":"VMiklos","fromEmail":"vmiklos@frugalware.org","sentAt":"2007-07-15T22:29:48Z","receivedAt":"2007-07-15T22:29:48Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Hello,\n\nNa Sun, Jul 15, 2007 at 11:45:30PM +0200, Sven Verdoolaege <skimo@kotnet.org> pisal(a):\n> You should do a git submodule init first.\n\nnice, now it works :)\n\nthen my question would be if the following workflow is possible or not:\n\n1) you told me how to do the following:\n\na) somebody updates libfoo\n\nb) a dev of main pulls libfoo, commits something like:\n\ndiff --git a/libfoo b/libfoo\nindex 07ceadb..459b61f 160000\n--- a/libfoo\n+++ b/libfoo\n@@ -1 +1 @@\n-Subproject commit 07ceadb17ca73636b0d96cb91688baecb1763d9b\n+Subproject commit 459b61fa4bba78a6e6542b8fcc0fd8f320eafa8c\n\nc) users have to \"git pull; git submodule update\" and they'll be happy\n\n2) is it possible to do this without step b)?\n\ni mean adding something like: \"Subproject commit HEAD\" or \"Subproject\ncommit mybranch\"\n\nthanks,\n- VMiklos\n"},{"id":"47528","messageId":"20070716103954.GM999MdfPADPa@greensroom.kotnet.org","threadId":"9027","inReplyTo":"20070715222948.GL7106@genesis.frugalware.org","subject":"Re: question about git-submodule","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2007-07-16T10:39:55Z","receivedAt":"2007-07-16T10:39:55Z","isPatch":false,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Mon, Jul 16, 2007 at 12:29:48AM +0200, VMiklos wrote:\n> 2) is it possible to do this without step b)?\n> \n> i mean adding something like: \"Subproject commit HEAD\" or \"Subproject\n> commit mybranch\"\n\nNo.  You have to specify the specific revision of the subproject\nthat is included in any revision of the superproject.\n\nImagine someone making an incompatible change to a subproject.\nYou do not want to get this change in your copy of the superproject\nunless the superproject has been adapted to this change.\n\nskimo\n"},{"id":"47533","messageId":"20070716110728.GQ7106@genesis.frugalware.org","threadId":"9027","inReplyTo":"20070716103954.GM999MdfPADPa@greensroom.kotnet.org","subject":"Re: question about git-submodule","fromName":"VMiklos","fromEmail":"vmiklos@frugalware.org","sentAt":"2007-07-16T11:07:28Z","receivedAt":"2007-07-16T11:07:28Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Hello,\n\nNa Mon, Jul 16, 2007 at 12:39:55PM +0200, Sven Verdoolaege <skimo@kotnet.org> pisal(a):\n> No.  You have to specify the specific revision of the subproject\n> that is included in any revision of the superproject.\n> \n> Imagine someone making an incompatible change to a subproject.\n> You do not want to get this change in your copy of the superproject\n> unless the superproject has been adapted to this change.\n\ni don't say that the ability to stick to a given commit is bad, but imho\nthere are scenarios where the ability to stick to a branch is better\n\nok, i know, probably i should send a patch if i want this, then it can\nbe discussed if this is useful or not\n\nanyway thanks for all your answers, now i at least know that what i\nwanted is currently not supported :)\n\n- VMiklos\n"},{"id":"49645","messageId":"46B3B3D2.6030000@tromer.org","threadId":"9027","inReplyTo":"20070715104712.GF2568@steel.home","subject":"Re: question about git-submodule","fromName":"Eran Tromer","fromEmail":"git2eran@tromer.org","sentAt":"2007-08-03T23:01:38Z","receivedAt":"2007-08-03T23:01:38Z","isPatch":false,"sender":{"key":"git2eran@tromer.org","avatar":null},"body":"On 2007-07-15 06:47, Alex Riesen wrote:\n> Sven Verdoolaege, Sun, Jul 15, 2007 10:39:59 +0200:\n>> On Fri, Jul 13, 2007 at 11:46:30PM +0200, VMiklos wrote:\n>>> i mean, first i thought that after configuring a submodule under libfoo,\n>>> then a git pull will update libfoo's repo under libfoo, too. or\n>>> something like that.\n>> Unless I've missed something, it doesn't.\n>> Some of use would like git to do just that (at least Alex Riesen,\n>> Martin Waitz and myself have sent in patches to that effect),\n>> but we haven't been able to convince Junio yet.\n> \n> Count me out. Junio convinced me instead and having tried the\n> subprojects I find it really convenient: I can choose when and what\n> should be updated and I can see what _can_ be updated, iff I decide\n> to. Subprojects defined in such a loosely way are more flexible then\n> having git-pull fetch subprojects by default. Sometimes I even want be\n> _sure_ the subprojects are completely untouched (I have some critical\n> parts in them).\n\nAll of the above also applies to normal files, not just submodules. So\nby this logic, maybe \"git pull\" and \"git checkout\" should by default\nupdate just the index, and require a manual \"git file update\" to update\nthe files in the working tree?\n\nLeaving the working tree (including submodules) in an inconsistent state\nright after a pull or checkout is a very strange thing to do. It means,\nfor example, that even simple switching between branches doesn't work in\na superproject. Consider this example (tested on next aac97aacbccd):\n\n--------------------------------------------------\nCreate the subproject repo:\n\n$ mkdir sub-to-be\n$ cd sub-to-be\n$ git init\n$ echo AAA > foo\n$ git add foo\n$ git commit -m sub\n$ cd ..\n\nCreate the superproject repo and clone subproject into it:\n\n$ mkdir super\n$ cd super\n$ git init\n$ git submodule add ../sub-to-be sub\n$ git commit -m super\n\nUpdate the submodule:\n\n$ cd sub\n$ echo BBB > foo\n$ git add foo\n$ git commit -m sub\n$ cd ..\n\nUpdate the supermodule:\n\n$ git add sub\n$ git commit -m super\n\nTry to switch between versions, and fail miserably:\n\n$ git checkout -b old HEAD^\nM       sub\nSwitched to a new branch \"old\"\n$ git checkout master\nfatal: Entry 'sub' not uptodate. Cannot merge.\n--------------------------------------------------\n\nBTW, is there any easy way to create a submodule directly inside the\nsupermodule's working tree, instead of cloning it as in the above example?\n\n  Eran\n"},{"id":"49901","messageId":"20070805145922.GC999MdfPADPa@greensroom.kotnet.org","threadId":"9027","inReplyTo":"46B3B3D2.6030000@tromer.org","subject":"Re: question about git-submodule","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2007-08-05T14:59:22Z","receivedAt":"2007-08-05T14:59:22Z","isPatch":false,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Fri, Aug 03, 2007 at 07:01:38PM -0400, Eran Tromer wrote:\n> $ mkdir super\n> $ cd super\n> $ git init\n> $ git submodule add ../sub-to-be sub\n\nYou probably don't want to do this as this URL\nprobably won't work for anyone who wants to clone\nyour superproject.\n\n> BTW, is there any easy way to create a submodule directly inside the\n> supermodule's working tree, instead of cloning it as in the above example?\n\nDo you want to use the submodule porcelain or just the plumbing?\nIf you simply want to add a submodule locally, \"git add\" will do that for\nyou just fine.  It's only when you want to make it easier for people who\nclone your superproject to get updates of the submodules that you\nshould set up the information required by \"git submodule\" in .gitmodules\n(see end of module_add in git-submodule.sh).\n\nNote that the \"url\" can be set directly in your git config\n(without specifying it in .gitmodules), but then anyone who clones\nfrom you will have to modify his config \"manually\" too.\nFor some reason, the \"path\" element is required, even if it is equal\nto the submodule name.\n\nskimo\n"},{"id":"50033","messageId":"46B75907.1070007@tromer.org","threadId":"9027","inReplyTo":"20070805145922.GC999MdfPADPa@greensroom.kotnet.org","subject":"Re: question about git-submodule","fromName":"Eran Tromer","fromEmail":"git2eran@tromer.org","sentAt":"2007-08-06T17:23:19Z","receivedAt":"2007-08-06T17:23:19Z","isPatch":false,"sender":{"key":"git2eran@tromer.org","avatar":null},"body":"On 2007-08-05 10:59, Sven Verdoolaege wrote:\n>> BTW, is there any easy way to create a submodule directly inside the\n>> supermodule's working tree, instead of cloning it as in the above example?\n> \n> Do you want to use the submodule porcelain or just the plumbing?\n> If you simply want to add a submodule locally, \"git add\" will do that for\n> you just fine.  It's only when you want to make it easier for people who\n> clone your superproject to get updates of the submodules that you\n> should set up the information required by \"git submodule\" in .gitmodules\n> (see end of module_add in git-submodule.sh).\n\nIf you just do \"git add sub\" (where sub is an existing repo subdir) then\nany subsequent \"git submodule update\" predictably complains:\n  No submodule mapping found in .gitmodules for path 'sub'\n\nAnd if you wire up .gitmodules manually, then \"git submodule update\"\nchokes on the \"git-fetch\" in modules_update().\n\nSo I suggest extending \"git submodule add\" to handle existing\nsubdirectories by simply using them as-is instead of creating a new\nclone. And \"git submodule update\" shouldn't try fetching when the commit\nis already present locally.\n\nSpeaking of which, currently \"git submodule\" clones/fetches *all*\nbranches on the remote repository, which seems quite excessive given\nthat the supermodule's content references just one submodule commit. By\ndefault, \"git submodule add\" should fetch only the needed head, and \"git\nsubmodule update\" should fetch only the commit sha1 (if needed).\n\n  Eran\n"}]}