I've been playing around with nested subtrees, and I've discovered
what I'm pretty sure is a bug: when I import a repo into a nested
directory with `git subtree add`, then split the imported directory's
parent, the subtree's history is lost.

To clarify:

# Create a repo with a single file
git init nested
cd nested
echo contents > test
git add test
git commit -m "Add foo"
cd ..

# Create an outer repo
git init outer
cd outer
echo contents > bar
git add bar
git commit -m "Add bar"

# Import nested into outer/dir/nested
git subtree add --prefix dir/nested ../nested master

# Split outer/dir
git subtree split --prefix dir --branch history-of-dir

Now `git log master` includes "Add foo" in its history but `git log
history-of-dir` doesn't, even though 'nested' is a child of 'dir'.

I have a (very) rough guess as to what's going on: `git subtree split`
sees the side of the merge importing nested's changes as only touching
files "outside of" the directory it's splitting out, so it happily
omits them from the split history.

Has anyone else run into this?

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

Reply via email to