git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Avery Pennarun <apenwarr@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: Announcement: git-subtrac (a sequel to git-subtree)
Date: Sun, 10 Nov 2019 01:44:30 -0500	[thread overview]
Message-ID: <CAHqTa-15fKjH-3Z-vHhgNpfx6c1OQXbDXwKJHT9JX6G+7tjGBA@mail.gmail.com> (raw)

Hi all,

Ten years ago (yikes!), I wrote git-subtree to work around some of
the usability problems with git submodules. I don't have much more
luck with submodules now than I did back then, but I've also never
been very happy with git-subtree's limitations. Luckily I've learned
a lot since then, so I've made another try at it.

Here's my new attempt, git-subtrac:
   https://github.com/apenwarr/git-subtrac

Unlike git-subtree, it encourages you to use an almost-pure git
submodule workflow. But like git-subtree, it makes it easy to include
the entire history (actually the "history of histories" since
submodules can go backwards, forwards, and sideways over time) of
the submodules in your superproject's repo.

As a result, it's easy to push, pull, fork, merge, and rebase your
entire project no matter how many submodules you like to use. When
someone does a 'fetch' of your superproject repo, they get all the
submodule repos as well.

The trick is pretty straightforward. Like git-subtree, we generate a
shadow history of commits, converting subtree links from inside trees into
additional parent commits. This causes them to be pushed/pulled as
part of a single ref. The shadow history is stable (anyone generating a
shadow tree from commit X will always get the same shadow tree X+)
and can be forked or merged just like the original tree. The idea is
that you'd have a branch called 'master.trac' that is the companion
to the 'master' branch, holding the submodule history needed to
checkout any commit in that branch.

Then you simply set "url = ." for every entry in .gitmodules, and off
it goes.

You could also use this as a tool for managing patch queues: create a
superproject with just one submodule that you want to patch. Every
time you rebase your patch queue, make a new commit in the
superproject, then tie it into a nice package with subtrac.

Anyway, comments welcome. This one is written in go using the go-git
library, which is very nice indeed, although it would presumably
prevent this from ever being merged into git itself.

Have fun,

Avery

                 reply	other threads:[~2019-11-10  6:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHqTa-15fKjH-3Z-vHhgNpfx6c1OQXbDXwKJHT9JX6G+7tjGBA@mail.gmail.com \
    --to=apenwarr@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).