{"thread":{"id":"54996","subject":"Repository of repositories without submodules?","startedAt":"2021-01-16T10:40:39Z","lastAt":"2021-01-16T17:13:52Z","messageCount":2,"participants":["Chuck Ricketts","Manuel Reimer"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"414495","messageId":"CAHS-jcAxNgZq4UNxyooftPn_nA_935THGdNHGk65UKURfkoTmA@mail.gmail.com","threadId":"54996","inReplyTo":null,"subject":"Repository of repositories without submodules?","fromName":"Chuck Ricketts","fromEmail":"chuck.the.pc.guy@gmail.com","sentAt":"2021-01-16T10:39:31Z","receivedAt":"2021-01-16T10:40:39Z","isPatch":false,"sender":{"key":"chuck.the.pc.guy@gmail.com","avatar":null},"body":"I am cross-compiling many Arch packages with small changes made\nlocally in order to better suit a cross-compiling environment. That\nbeing said, I've got a directory of single-directory git repos that I\nwould like to publish my changes to.\n\nI ran into more than a few snags trying to figure out how to do this.\nFirstly, no matter what, if git sees a directory in the repo with a\n.git file or folder, it automatically classifies it as a submodule --\nno questions asked. Of course, as submodules the contents aren't able\nto be pushed (so far as I can figure out, anyway) because, I presume,\nthe assumption is that they're able to be retrieved at an alternate\nlocation.\n\nIn my project, this leads to a few issues:\n1) My local changes will not be pushable without pushing the whole\norigin repository upstream to another location. I guess I could try to\nstrip down the history to only a few files to make it more manageable,\nbut in the end there might be a hundred or so different repos.\n2) The changes I have made are very small, especially when compared to\nthe size of the repositories that those changes are based on --\npushing the origin repo upstream is potentially wasteful even given\noptions from #1.\n3) Using the submodule method I would have to originate every\nsubdirectory as a separate cloneable repo just to get them organized\ninto a directory structure that makes sense. Of course, each repo is\ngoing to have to be managed separately, which adds tremendously to\nproject overhead if it's a public repository (which I plan it being).\nOf course, that's no to mention the potential nightmare of having to\nkeep those submodule references updated.\n\nIn my eyes, it would be so much simpler to tell git \"Hey, I know these\nare repositories, but just ignore that, mmk?\" This way I can still\nmanage each folder as a separate repo for merging upstream changes,\netc. and I don't have to deal with any of the other issues.\n\nI bypassed this issue by bare cloning all of the separate repos into\nan ignored subdirectory. Then, I used worktrees to check them out to\nthe locations where I want them. And, finally, I had to use some shell\nscripting hackery to create and destroy the .git file in each of the\nsubdirectories as I move around so that when I go to add files for\ncommit git doesn't think it's a repo and treat it like a submodule\nagainst my wishes.\n\nI mean, it works, but it doesn't seem like a good, correct, or\nespecially sane way to go about it. Surely I've missed something?\n\nChuck Ricketts\n"},{"id":"414503","messageId":"c92b380f-08da-f31b-4dc4-ff43a1ac256f@m-reimer.de","threadId":"54996","inReplyTo":"CAHS-jcAxNgZq4UNxyooftPn_nA_935THGdNHGk65UKURfkoTmA@mail.gmail.com","subject":"Re: Repository of repositories without submodules?","fromName":"Manuel Reimer","fromEmail":"mail+git@m-reimer.de","sentAt":"2021-01-16T14:01:31Z","receivedAt":"2021-01-16T17:13:52Z","isPatch":false,"sender":{"key":"mail+git@m-reimer.de","avatar":null},"body":"On 16.01.21 11:39, Chuck Ricketts wrote:\n> I am cross-compiling many Arch packages with small changes made\n> locally in order to better suit a cross-compiling environment. That\n> being said, I've got a directory of single-directory git repos that I\n> would like to publish my changes to.\n\nSeems like the common \"several directory GIT\" case caused by the fact \nthat AUR organizes all PKGBUILDs in separate repos.\n\nFor me \"git subtree\" works great for this case:\n\nhttps://github.com/M-Reimer/PKGBUILDs\nor\nhttps://github.com/M-Reimer/wine-lol\n\nSee the \"pkg.sh\" file which, to be honest, isn't even from me. I just \nadapted it slightly to my use case. Original came from here:\n\nhttps://github.com/yuvadm/archlinux-packages/blob/master/pkg.sh\n\nEvery single PKGBUILD is its own \"subtree\" which can be pushed \nseparately to AUR if I want to. Pushing this subtree makes GIT somehow \n\"automagically\" figure out a proper commit history for this subdirectory \nand push this to the external repo.\n\nManuel\n"}]}