git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / 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
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 index

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

Reply instructions:

You may reply publically 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

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git