git subtree issues

3 messages Options
Embed this post
Permalink
morgflast

git subtree issues

Reply Threaded More More options
Print post
Permalink

So, I went ahead and did this

$ git remote add -f vw_extensions [hidden email]:sibblingz/vw_extensions.git
(1)
$ git merge -s ours --no-commit vw_extensions/master (2)
$ git read-tree --prefix=some/directory/vw_extensions -u
vw_extensions/master (3)
$ git commit -m "Merge B project as our subdirectory"

And that all seems to work ok.

Then, I went to another directory where i had vw_extensions cloned, and made
a change to the README file, and pushed it.

I went back to my first project, and did this, to try to pull those changes:

git pull -s subtree vw_extensions master remote: Counting objects: 5, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From [hidden email]:sibblingz/vw_extensions
 * branch            master     -> FETCH_HEAD
Already uptodate!
Merge made by subtree.

However, when I looked at the README file in the first project, the changes
weren't there.  I was wondering if anyone might have any suggestions about
what to do.

Thanks!
Daniel

--
View this message in context: http://old.nabble.com/git-subtree-issues-tp26159961p26159961.html
Sent from the git mailing list archive at Nabble.com.

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

Re: git subtree issues

Reply Threaded More More options
Print post
Permalink
On Mon, Nov 2, 2009 at 11:56 PM, morgflast <[hidden email]> wrote:

> git pull -s subtree vw_extensions master remote: Counting objects: 5, done.
> remote: Compressing objects: 100% (3/3), done.
> remote: Total 3 (delta 2), reused 0 (delta 0)
> Unpacking objects: 100% (3/3), done.
> From [hidden email]:sibblingz/vw_extensions
>  * branch            master     -> FETCH_HEAD
> Already uptodate!
> Merge made by subtree.
>
> However, when I looked at the README file in the first project, the changes
> weren't there.  I was wondering if anyone might have any suggestions about
> what to do.

Hmm, the output certainly wasn't very helpful :(

Usually what "already uptodate" means is that the commit it merged
didn't actually cause any changes.  Is it possible there's another
README file that already contained this change?

The other problem with subtree merge is that it tries to *guess* which
subtree you want to merge, which unfortunately fails almost as often
as it succeeds.  If it guessed incorrectly, it might have thrown away
all the directories except one that didn't change at all.  If this is
the problem, I don't have an easy fix; my git-subtree command (which
makes it a bit easier to do the things you're trying to do in your
email) suffers from this too.  Eventually I was thinking of giving in
and making subtree merge properly configurable, but I haven't had
time.

Or maybe this is a totally different problem.  What do you get from:

  git diff --stat $(git merge-base HEAD^ FETCH_HEAD) FETCH_HEAD

?

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

Re: git subtree issues

Reply Threaded More More options
Print post
Permalink
On Tue, Nov 3, 2009 at 1:19 PM, Daniel Jacobs <[hidden email]> wrote:

> Ok.. I ran the command as you suggested
> git pull -s subtree vw_extensions master
> remote: Counting objects: 5, done.
> remote: Compressing objects: 100% (3/3), done.
> remote: Total 3 (delta 2), reused 0 (delta 0)
> Unpacking objects: 100% (3/3), done.
> From [hidden email]:sibblingz/vw_extensions
>  * branch            master     -> FETCH_HEAD
> Already uptodate!
> Merge made by subtree.
>
> git diff --stat $(git merge-base HEAD^ FETCH_HEAD) FETCH_HEAD
>  README |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> So, it knows there was a change.  However, when I go and vim that README
> file, the change is not there.  Maybe this gives you some more information.

This is extremely fishy.  What if you re-run the pull without the "-s
subtree" at all?  git must be trying to merge those changes in
*somewhere*...

> As an aside, I saw your git subtree tool, and it looks great, but I did not
> try to use it because I could not figure out how to install it.  You might
> get a few more users if you include instructions for installation somewhere.
>  :-)

Oops, good point.  Somehow I forgot that.  Fixed.

Thanks,

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