{"thread":{"id":"11669","subject":"git submodule when submodule is not a clone of a repository","startedAt":"2008-01-18T17:25:20Z","lastAt":"2008-01-18T23:26:42Z","messageCount":3,"participants":["Sergio Callegari","Lars Hjemli","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"65900","messageId":"loom.20080118T171433-93@post.gmane.org","threadId":"11669","inReplyTo":null,"subject":"git submodule when submodule is not a clone of a repository","fromName":"Sergio Callegari","fromEmail":"sergio.callegari@gmail.com","sentAt":"2008-01-18T17:25:20Z","receivedAt":"2008-01-18T17:25:20Z","isPatch":false,"sender":{"key":"sergio.callegari@gmail.com","avatar":"https://gravatar.com/avatar/c98f41317e0422c1e630385de0e3970227b8e5ad15f35ba8586066467cc833bc?d=mp&s=160"},"body":"Hi,\n\nI am trying to use submodules to keep a project organized.\nI am using a workflow that is probably not the common one and I am running into\nproblems.\n\nBasically, I have a superproject TOP, with subproject A and B. The thing is that\nA and B are _not_ cloned from some existing repo.  They are two brand new\nrepositories created with git init.\n\nBasically, I am doing this so that in the superproject I commit states with\nspecific versions of A and B (that are logically distinct things) that are known\nto work fine together. Also I am doing this since A and B are actually just\nstarted with TOP, but I have a provision of making them independently developed\nthings, so I like to have them separated from start.\n\nThe thing is that git-submodule makes very strong assumptions on A and B.\nParticularly, if there is no url defined from them some commands (notably\nupdate) will fail.\n\nSo I need to make a fake url for the submodule (e.g. .) and a fake origin for it\n(again .)\n\nWould it make sense to have a git submodule update not try to fetch if there is\nno url defined, but still checkout the right commit for the submodule (rather\nthan skipping the submodule at all) ?\n\nSergio\n"},{"id":"65902","messageId":"8c5c35580801180946q3ba824e2s4c32ac504166c684@mail.gmail.com","threadId":"11669","inReplyTo":"loom.20080118T171433-93@post.gmane.org","subject":"Re: git submodule when submodule is not a clone of a repository","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2008-01-18T17:46:03Z","receivedAt":"2008-01-18T17:46:03Z","isPatch":false,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"On Jan 18, 2008 6:25 PM, Sergio Callegari <sergio.callegari@gmail.com> wrote:\n> Would it make sense to have a git submodule update not try to fetch if there is\n> no url defined, but still checkout the right commit for the submodule (rather\n> than skipping the submodule at all) ?\n\nActually, we could (and probably should) teach git-submodule not to\nfetch if the requested SHA1 is already available in the submodule, and\nI guess this would solve the problem quite nicely for your usage.\n\nBut that will probably not happen before 1.5.4.\n\n--\nlarsh\n"},{"id":"65933","messageId":"7v3asubtql.fsf@gitster.siamese.dyndns.org","threadId":"11669","inReplyTo":"8c5c35580801180946q3ba824e2s4c32ac504166c684@mail.gmail.com","subject":"Re: git submodule when submodule is not a clone of a repository","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-18T23:26:42Z","receivedAt":"2008-01-18T23:26:42Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Lars Hjemli\" <hjemli@gmail.com> writes:\n\n> Actually, we could (and probably should) teach git-submodule not to\n> fetch if the requested SHA1 is already available in the submodule,..\n\nI think that is a very sensible optimization.\n"}]}