{"thread":{"id":"16849","subject":"Questions about repo and git submodule","startedAt":"2008-12-23T14:01:28Z","lastAt":"2008-12-27T17:45:53Z","messageCount":4,"participants":["Emily Ren","Shawn O. Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"98607","messageId":"856bfe0e0812230601m1765b483pe62c7902849e9cea@mail.gmail.com","threadId":"16849","inReplyTo":null,"subject":"Questions about repo and git submodule","fromName":"Emily Ren","fromEmail":"lingyan.ren@gmail.com","sentAt":"2008-12-23T14:01:28Z","receivedAt":"2008-12-23T14:01:28Z","isPatch":false,"sender":{"key":"lingyan.ren@gmail.com","avatar":null},"body":"All,\n\nI have some questions about android repo and git submodule.\n\nI created a repo repository with below commands:\n1.  repo init -u git://android.git.kernel.org/platform/manifest.git\n2.  repo initialized in /android\n\n1. The android dir is not a git repository, if other people clone my\nandroid code, how does it work?\n2. I want to make android dir to be a git repository, is it workable\nthat I create submodule for each subdirectory in another directory? Is\nthere a script for it?\n\nThank you ！\n\nEmily\n"},{"id":"98618","messageId":"20081223152951.GB27865@spearce.org","threadId":"16849","inReplyTo":"856bfe0e0812230601m1765b483pe62c7902849e9cea@mail.gmail.com","subject":"Re: Questions about repo and git submodule","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-12-23T15:29:51Z","receivedAt":"2008-12-23T15:29:51Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Emily Ren <lingyan.ren@gmail.com> wrote:\n> \n> I have some questions about android repo and git submodule.\n> \n> I created a repo repository with below commands:\n> 1.  repo init -u git://android.git.kernel.org/platform/manifest.git\n> 2.  repo initialized in /android\n> \n> 1. The android dir is not a git repository,\n\nCorrect, it is not a git repository.  The repo tool does not use\ngit submodules.  The top level of a repo client has a \".repo/\"\ndirectory with metadata, not a \".git/\" directory.  The table of\ncontents (the subprojects) is stored in XML files under \".repo/\".\n\n<aside>\nI actually fought against the XML format for repo's manifest, but\nothers felt it was suitable.  And then walked away from the project\nafter Android open-sourced its code tree.  Leaving me to maintain it.\nI see a file format simplification in the future for repo.\n</aside>\n\n> if other people clone my\n> android code, how does it work?\n\nSadly this isn't supported correctly.  You can't initialize one\nrepo client from another, even though you can git clone one git\nrepository from any other.  Its a bug in repo's design.  The data\nunder \".repo/projects/\" isn't laid out correctly to permit reuse\nof one repo client to initialize another.\n\nIts something I keep meaning to fix, but its going to take some\nreal effort.\n\nIn the mean time, there is a \"--mirror\" flag to repo init\nwhich can be used to clone everything into bare repositories.\nThose bare repositories can be published for others to repo init\nfrom, though you need to customize the manifest.git:default.xml\nso that the embedded URL refers back to your server and not\nandroid.git.kernel.org.  Yet another thing I want to fix.\n\n> 2. I want to make android dir to be a git repository, is it workable\n> that I create submodule for each subdirectory in another directory? Is\n> there a script for it?\n\nYou might be able to do something like this:\n\n\tcd /android\n\tgit init\n\trepo forall -c 'cd /android && git submodule add `pwd`'\n\nAlso, you might want to consider asking questions related to repo\non the repo-discuss@googlegroups.com mailing list.  There's a lot\nmore repo users there than on the git mailing list, and they have\nstarted to come up with their own \"tips n tricks\".\n\n-- \nShawn.\n"},{"id":"98680","messageId":"856bfe0e0812242228o6a428702i296dc87c76cf9dba@mail.gmail.com","threadId":"16849","inReplyTo":"20081223152951.GB27865@spearce.org","subject":"Re: Questions about repo and git submodule","fromName":"Emily Ren","fromEmail":"lingyan.ren@gmail.com","sentAt":"2008-12-25T06:28:06Z","receivedAt":"2008-12-25T06:28:06Z","isPatch":false,"sender":{"key":"lingyan.ren@gmail.com","avatar":null},"body":"Hi Shawn,\n\nMerry Christmas !\n\nThank you for your guide ! I've created git repository with submodules\nwith a simple script successfully.\n\nNow I have another question,  since my android repo will always sync\nup from android.git.kernel.org, my git repository needs to be updated\naccordingly.  Is there a tool I can use to sync up from repo to git\nrepositoy ?\n\nThanks,\nEmily\n\nOn Tue, Dec 23, 2008 at 11:29 PM, Shawn O. Pearce <spearce@spearce.org> wrote:\n> Emily Ren <lingyan.ren@gmail.com> wrote:\n>>\n>> I have some questions about android repo and git submodule.\n>>\n>> I created a repo repository with below commands:\n>> 1.  repo init -u git://android.git.kernel.org/platform/manifest.git\n>> 2.  repo initialized in /android\n>>\n>> 1. The android dir is not a git repository,\n>\n> Correct, it is not a git repository.  The repo tool does not use\n> git submodules.  The top level of a repo client has a \".repo/\"\n> directory with metadata, not a \".git/\" directory.  The table of\n> contents (the subprojects) is stored in XML files under \".repo/\".\n>\n> <aside>\n> I actually fought against the XML format for repo's manifest, but\n> others felt it was suitable.  And then walked away from the project\n> after Android open-sourced its code tree.  Leaving me to maintain it.\n> I see a file format simplification in the future for repo.\n> </aside>\n>\n>> if other people clone my\n>> android code, how does it work?\n>\n> Sadly this isn't supported correctly.  You can't initialize one\n> repo client from another, even though you can git clone one git\n> repository from any other.  Its a bug in repo's design.  The data\n> under \".repo/projects/\" isn't laid out correctly to permit reuse\n> of one repo client to initialize another.\n>\n> Its something I keep meaning to fix, but its going to take some\n> real effort.\n>\n> In the mean time, there is a \"--mirror\" flag to repo init\n> which can be used to clone everything into bare repositories.\n> Those bare repositories can be published for others to repo init\n> from, though you need to customize the manifest.git:default.xml\n> so that the embedded URL refers back to your server and not\n> android.git.kernel.org.  Yet another thing I want to fix.\n>\n>> 2. I want to make android dir to be a git repository, is it workable\n>> that I create submodule for each subdirectory in another directory? Is\n>> there a script for it?\n>\n> You might be able to do something like this:\n>\n>        cd /android\n>        git init\n>        repo forall -c 'cd /android && git submodule add `pwd`'\n>\n> Also, you might want to consider asking questions related to repo\n> on the repo-discuss@googlegroups.com mailing list.  There's a lot\n> more repo users there than on the git mailing list, and they have\n> started to come up with their own \"tips n tricks\".\n>\n> --\n> Shawn.\n>\n"},{"id":"98798","messageId":"20081227174553.GC22075@spearce.org","threadId":"16849","inReplyTo":"856bfe0e0812242228o6a428702i296dc87c76cf9dba@mail.gmail.com","subject":"Re: Questions about repo and git submodule","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-12-27T17:45:53Z","receivedAt":"2008-12-27T17:45:53Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Emily Ren <lingyan.ren@gmail.com> wrote:\n> Thank you for your guide ! I've created git repository with submodules\n> with a simple script successfully.\n> \n> Now I have another question,  since my android repo will always sync\n> up from android.git.kernel.org, my git repository needs to be updated\n> accordingly.  Is there a tool I can use to sync up from repo to git\n> repositoy ?\n\nI think this discussion has moved to the repo-discuss list:\n\n  https://groups.google.com/group/repo-discuss/browse_thread/thread/2fa368ed7cac5d79\n\n-- \nShawn.\n"}]}