Re: Subtree with submodule inside?

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

 



Jens Lehmann wrote:

> There were thoughts about having "git branch" optionally create a
> branch in the submodule too. But in a lot of real world scenarios
> that won't help because the same branch name won't necessarily make
> sense in superproject and submodule at the same time

So, here is how I think git could behave to make that into a
non-issue:

 1. Commands like 'git checkout' able to recurse into submodules, so
    when you switch branches in the superproject, the files in the
    submodule are at the right commit, too.

    Luckily your series does that.  Ronnie was helping me with thoughts
    about how to simplify the patch a little, and I'd be happy to talk
    with or coordinate with anyone else interested (by email or on IRC
    --- I am jrnieder on Freenode).

 2. Submodules aware of their superproject and of the parent's branches.
    In other words, submodules would act as thought under refs/ they
    had a symlink

	parent -> ../../../refs

    So you could do

	git checkout --recurse-submodules master

	cd path/to/submodule
	git checkout parent/heads/next

    This would avoid danger from "git gc" in submodules and would
    get rid of most of the motivation for named branches in the
    submodule, I'd think.

 3. That's it.

Sensible?

Thanks,
Jonathan
--
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]