{"thread":{"id":"52229","subject":"Announcement: git-subtrac (a sequel to git-subtree)","startedAt":"2019-11-10T06:44:44Z","lastAt":"2019-11-10T06:44:44Z","messageCount":1,"participants":["Avery Pennarun"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"385840","messageId":"CAHqTa-15fKjH-3Z-vHhgNpfx6c1OQXbDXwKJHT9JX6G+7tjGBA@mail.gmail.com","threadId":"52229","inReplyTo":null,"subject":"Announcement: git-subtrac (a sequel to git-subtree)","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2019-11-10T06:44:30Z","receivedAt":"2019-11-10T06:44:44Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"Hi all,\n\nTen years ago (yikes!), I wrote git-subtree to work around some of\nthe usability problems with git submodules. I don't have much more\nluck with submodules now than I did back then, but I've also never\nbeen very happy with git-subtree's limitations. Luckily I've learned\na lot since then, so I've made another try at it.\n\nHere's my new attempt, git-subtrac:\n   https://github.com/apenwarr/git-subtrac\n\nUnlike git-subtree, it encourages you to use an almost-pure git\nsubmodule workflow. But like git-subtree, it makes it easy to include\nthe entire history (actually the \"history of histories\" since\nsubmodules can go backwards, forwards, and sideways over time) of\nthe submodules in your superproject's repo.\n\nAs a result, it's easy to push, pull, fork, merge, and rebase your\nentire project no matter how many submodules you like to use. When\nsomeone does a 'fetch' of your superproject repo, they get all the\nsubmodule repos as well.\n\nThe trick is pretty straightforward. Like git-subtree, we generate a\nshadow history of commits, converting subtree links from inside trees into\nadditional parent commits. This causes them to be pushed/pulled as\npart of a single ref. The shadow history is stable (anyone generating a\nshadow tree from commit X will always get the same shadow tree X+)\nand can be forked or merged just like the original tree. The idea is\nthat you'd have a branch called 'master.trac' that is the companion\nto the 'master' branch, holding the submodule history needed to\ncheckout any commit in that branch.\n\nThen you simply set \"url = .\" for every entry in .gitmodules, and off\nit goes.\n\nYou could also use this as a tool for managing patch queues: create a\nsuperproject with just one submodule that you want to patch. Every\ntime you rebase your patch queue, make a new commit in the\nsuperproject, then tie it into a nice package with subtrac.\n\nAnyway, comments welcome. This one is written in go using the go-git\nlibrary, which is very nice indeed, although it would presumably\nprevent this from ever being merged into git itself.\n\nHave fun,\n\nAvery\n"}]}