* git remote vs. submodules
@ 2010-11-11 1:45 Patrick Doyle
2010-11-11 11:34 ` Tomas Carnecky
0 siblings, 1 reply; 5+ messages in thread
From: Patrick Doyle @ 2010-11-11 1:45 UTC (permalink / raw)
To: git
Hello All,
I was just reading about git remote and I started thinking to myself,
"Gee, nothing I've read says that the remotes have to share a common
ancestor. I wonder what would happen if I added two independent
repositories as remotes to a superproject?"
So I tried it in a very trivial case. The first thing I learned was
that I need to make the subprojects subdirectories of a top level
.git-housing directory. Or else, when I merge them in, everything in
the top level of subproject1 gets mixed in with everything in the top
level of subproject2. So this doesn't seem to be a good solution for
marrying arbitrary subprojects together. But if I set up a library of
subprojects properly, it seems like I could do this.
So now I'm wondering... has anybody else ever had thoughts along these
lines? Has anybody tried this? Has anybody seen it work (or fail
miserably)?
Why would I want to do this instead of using submodules? I dunno. It
just came to mind when I started trying to understand what's really
going on with remotes. And I vaguely (and perhaps even correctly)
recall there being some controversy regarding submodules when they
were first introduced.
Anyway, I figured It wouldn't hurt to ask folks in the know.
--wpd
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git remote vs. submodules
2010-11-11 1:45 git remote vs. submodules Patrick Doyle
@ 2010-11-11 11:34 ` Tomas Carnecky
2010-11-11 14:44 ` Patrick Doyle
0 siblings, 1 reply; 5+ messages in thread
From: Tomas Carnecky @ 2010-11-11 11:34 UTC (permalink / raw)
To: Patrick Doyle; +Cc: git
On 11/11/10 2:45 AM, Patrick Doyle wrote:
> Hello All,
> I was just reading about git remote and I started thinking to myself,
> "Gee, nothing I've read says that the remotes have to share a common
> ancestor. I wonder what would happen if I added two independent
> repositories as remotes to a superproject?"
>
> So I tried it in a very trivial case. The first thing I learned was
> that I need to make the subprojects subdirectories of a top level
> .git-housing directory. Or else, when I merge them in, everything in
> the top level of subproject1 gets mixed in with everything in the top
> level of subproject2. So this doesn't seem to be a good solution for
> marrying arbitrary subprojects together. But if I set up a library of
> subprojects properly, it seems like I could do this.
>
> So now I'm wondering... has anybody else ever had thoughts along these
> lines? Has anybody tried this? Has anybody seen it work (or fail
> miserably)?
>
> Why would I want to do this instead of using submodules? I dunno. It
> just came to mind when I started trying to understand what's really
> going on with remotes. And I vaguely (and perhaps even correctly)
> recall there being some controversy regarding submodules when they
> were first introduced.
Are you maybe looking for a subtree merge?
http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html
tom
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git remote vs. submodules
2010-11-11 11:34 ` Tomas Carnecky
@ 2010-11-11 14:44 ` Patrick Doyle
2010-11-11 15:00 ` Tomas Carnecky
0 siblings, 1 reply; 5+ messages in thread
From: Patrick Doyle @ 2010-11-11 14:44 UTC (permalink / raw)
To: Tomas Carnecky; +Cc: git
On Thu, Nov 11, 2010 at 6:34 AM, Tomas Carnecky <tom@dbservice.com> wrote:
> Are you maybe looking for a subtree merge?
> http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html
Yeah, that looks like it. I never would have hit upon the read-tree
step by myself -- I would have just laid things out with the prefix
already embedded in the subprojects.
Hmmm... it seems to me that feeding changes back to the subprojects
might be difficult (and that is born out by a comment at the end of
the page you referenced.)
How much do folks use this approach?
--wpd
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git remote vs. submodules
2010-11-11 14:44 ` Patrick Doyle
@ 2010-11-11 15:00 ` Tomas Carnecky
2010-11-11 15:11 ` Patrick Doyle
0 siblings, 1 reply; 5+ messages in thread
From: Tomas Carnecky @ 2010-11-11 15:00 UTC (permalink / raw)
To: Patrick Doyle; +Cc: git
On 11/11/10 3:44 PM, Patrick Doyle wrote:
> On Thu, Nov 11, 2010 at 6:34 AM, Tomas Carnecky <tom@dbservice.com> wrote:
>> Are you maybe looking for a subtree merge?
>> http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html
>
> Yeah, that looks like it. I never would have hit upon the read-tree
> step by myself -- I would have just laid things out with the prefix
> already embedded in the subprojects.
>
> Hmmm... it seems to me that feeding changes back to the subprojects
> might be difficult (and that is born out by a comment at the end of
> the page you referenced.)
https://github.com/apenwarr/git-subtree, it makes exactly that easier.
tom
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git remote vs. submodules
2010-11-11 15:00 ` Tomas Carnecky
@ 2010-11-11 15:11 ` Patrick Doyle
0 siblings, 0 replies; 5+ messages in thread
From: Patrick Doyle @ 2010-11-11 15:11 UTC (permalink / raw)
To: Tomas Carnecky; +Cc: git
On Thu, Nov 11, 2010 at 10:00 AM, Tomas Carnecky <tom@dbservice.com> wrote:
> On 11/11/10 3:44 PM, Patrick Doyle wrote:
>> On Thu, Nov 11, 2010 at 6:34 AM, Tomas Carnecky <tom@dbservice.com> wrote:
>>> Are you maybe looking for a subtree merge?
>>> http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html
>>
>> Yeah, that looks like it. I never would have hit upon the read-tree
>> step by myself -- I would have just laid things out with the prefix
>> already embedded in the subprojects.
>>
>> Hmmm... it seems to me that feeding changes back to the subprojects
>> might be difficult (and that is born out by a comment at the end of
>> the page you referenced.)
>
> https://github.com/apenwarr/git-subtree, it makes exactly that easier.
That looks cool too! Thanks.
--wpd
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-11-11 15:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-11 1:45 git remote vs. submodules Patrick Doyle
2010-11-11 11:34 ` Tomas Carnecky
2010-11-11 14:44 ` Patrick Doyle
2010-11-11 15:00 ` Tomas Carnecky
2010-11-11 15:11 ` Patrick Doyle
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 NNTP newsgroup(s).