Re: dependable submodules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 21, 2011 at 8:56 PM, Daniel <daniel@xxxxxxxxxxx> wrote:
> I tried git-subtree. thanks but this is not what I wanted. This
> removed the .git dir for the subtree and hence updating the subtree is
> not easy.
>
> I want the functionality of git submodule except that I don't want the
> version checked in as part of the superproject to have to be fetched
> remotely.

Well, as the logic goes, you commit to the imported project a lot more
often than you submit upstream, so git-subtree makes the common part
much easier and the less-common part slightly harder, which is a
better tradeoff than git submodules.  But it does seem to be a matter
of preference.

If you just want the submodule's commit to be auto-fetched from the
same repo as the supermodule, I've been experimenting with a tool I've
created called 'git tie' that makes this possible.  It's not yet ready
for prime time, but you can use the same trick yourself if you're in a
hurry.  The idea is simple enough: just maintain a branch named
refs/heads/tie that is a continually updated "merge -s ours" of all
your submodule commits, all jammed together in a single branch that
nobody will ever look at.

Then when you 'git fetch origin', it'll fetch both the 'tie' branch
and all your other branches, which have references to the commits in
the 'tie' branch.  The 'tie' branch is what makes it so they'll get
auto-downloaded.  (Don't forget to push it, too, when you push
master.)

The tool I'm working on is basically just one that will auto-maintain
the 'tie' branch for you.

Oh, and the second half of this is to just use '.' in your .gitmodules
as the path to your submodule repo.  It would be nice if 'git
submodule update' would use the alternates mechanism (git clone
--reference) to get all objects from your subproject's local repo,
since we know they're there anyway.  I was going to make 'git tie' do
this part right too, so you wouldn't even need a .gitmodules file.
But either way, you'll survive, it might just be slower than optimal
if it downloads everything twice.

And there you go... I've now told you my secrets and regaled you with
vapourware.  Hope that helps more than it hurts :)

Have fun,

Avery
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]