Git development
 help / color / mirror / Atom feed
From: David Aguilar <davvid@gmail.com>
To: Nils Adermann <naderman@naderman.de>
Cc: git@vger.kernel.org
Subject: Re: subtree merge tries to merge into wrong directory
Date: Wed, 9 Dec 2009 20:20:08 -0800	[thread overview]
Message-ID: <20091210042008.GA3398@gmail.com> (raw)
In-Reply-To: <4B206DCF.90202@naderman.de>

On Thu, Dec 10, 2009 at 04:41:03AM +0100, Nils Adermann wrote:
> Following  
> http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html 
> I have subtree merged a 3rd party library (ezc-reflection) into my  
> repository (pflow). The prefix I used was lib/ezc/trunk/Reflection. Now  
> there have been changes to ezc-reflection but merging them into my  
> repository fails. The merge is attempted in example/ rather than  
> lib/ezc/trunk/Reflection.
>
> I originally set this up with:
>
> git remote add -f ezc-reflection /path/to/ezc-reflection
> git merge -s ours --no-commit ezc-reflection/master
> git read-tree --prefix=lib/ezc/trunk/Reflection -u ezc-reflection/master
>
> Reproduce my problem by executing the following:
>
> git clone git://github.com/naderman/pflow.git
> cd pflow
> git reset --hard f3e001e3
> git fetch git://github.com/naderman/ezc-reflection.git master
> git merge -s subtree FETCH_HEAD
>
> As you see this results in:
>
> CONFLICT (delete/modify): example/src/doc_comment_parser.php deleted in  
> HEAD and modified in FETCH_HEAD. Version FETCH_HEAD of  
> example/src/doc_comment_parser.php left in tree.
> Automatic merge failed; fix conflicts and then commit the result.
>
> As long as I don't make any changes to lib/ezc/trunk/Reflection that I  
> want to merge I can work around this by simply repeating my original  
> process like this:
>
> git clone git://github.com/naderman/pflow.git
> cd pflow
> git reset --hard f3e001e3
> git fetch git://github.com/naderman/ezc-reflection.git master
> git merge -s ours --no-commit FETCH_HEAD
> git rm -r lib/ezc/trunk/Reflection/
> git read-tree --prefix=lib/ezc/trunk/Reflection/ -u FETCH_HEAD
>
> Why does this problem occur and how can I get the merge to work properly?

I'm not sure, but maybe you can try git-subtree?
It makes this stuff easier for mere mortals.

http://github.com/apenwarr/git-subtree/

You might need to start redo your repo, but several people have
had good success with git-subtree.


-- 
		David

  reply	other threads:[~2009-12-10  4:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-10  3:41 subtree merge tries to merge into wrong directory Nils Adermann
2009-12-10  4:20 ` David Aguilar [this message]
2009-12-10  4:26   ` Nils Adermann
2009-12-10 14:38 ` Avery Pennarun
2009-12-16 18:05   ` naderman
2010-01-02 18:17     ` Nils Adermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091210042008.GA3398@gmail.com \
    --to=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=naderman@naderman.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox