Thread (4 messages) flat view 4 messages, 2 authors, 2016-06-15

Re: Subtree merging of sub-directories between repositories?

From: Avery Pennarun <hidden>
Date: 2016-06-15 22:47:08

On Sun, Aug 2, 2009 at 2:05 PM, [off-list ref] wrote:
On Sun, Aug 2, 2009 at 1:30 AM, Avery Pennarun[off-list ref] wrote:
quoted
2) Use "git subtree split" to take the subdir of A and give it a
history of its own, then merge that history into a subdir of B (using
"git subtree add" or any other subtree merge method you want to use).
You can then git subtree split/merge back and forth between A and B in
the future to copy future changes from one to the other.
Thanks for the help. I tried #2 and it sort of worked. The history was
imported, but the resulting paths were flattened. Here's what I did:
[...]
The full history doesn't seem to be associated with that directory. If
I do 'git log --name-only --topo-order', I see the full history, but
the files are listed as:

file.c

and I was expecting to see:

X/Y/C/file.c

Because I'd want to be able to do 'git log X/Y/C' and see all the
commits that affect that directory.
Yeah, this is a tricky one.  Git has all the necessary information to
"know" that the files were "moved" from file.c (in the subtree project
history) to X/Y/C.file.c (in your superproject).  But "git log"
doesn't use this information for anything at the moment, and
"--follow" doesn't seem to make it work.

Since I don't have the required skills or knowledge to fix git's
history following, my hope is that this will magically start working
in a future version of git because someone like you gets annoyed with
it :)

Have fun,

Avery
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help