From: Eugene Sajine <euguess@gmail.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git merge - "both added" conflict resolution
Date: Wed, 4 Aug 2010 19:29:21 -0400 [thread overview]
Message-ID: <AANLkTi=dScNMsf4XZ+sS8R+424fESyOr6wYO4WamAutj@mail.gmail.com> (raw)
In-Reply-To: <20100804205916.GC2920@burratino>
On Wed, Aug 4, 2010 at 4:59 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Hi Eugene,
>
> Eugene Sajine wrote:
>
> [in an add/add conflict]
>> when i resolve the conflict the build.xml returns to its
>> last committed state of dest repo, so git cannot determine any
>> changes.
>> Therefore, i cannot execute git add for this file and i cannot commit
>> my merge results
>
> Could you explain further (preferrably with a simple example
> transcript)? I would think that after an add/add conflict,
> a simple "git add" would mark the file resolved and allow
> committing.
>
Let's say in a source repository i have a master branch with few
coomits and only two files file1.java and build.xml
build.xml is as simple as few lines one of which is
...
<property name=projectName value=projectOne/>
...
In the second *unrelated* repository which is the destination for
merge I have a master branch with two files: file2.java and build.xml
this build.xml is absolutely identical with an exception of the
projectName property
...
<property name=projectName value=projectTwo/>
...
I'm doing
$ cd projecttwo (I'm in master branch)
$ git add remote temp ../projectone
$ git fetch temp
$ git merge temp/master
here i'm getting a conflict in build.xml.
file1.java is succesfully staged for commit
For build.xml git status gives me
...
both added: build.xml
...
Now i have to resolve the conflict on build.xml and as I'm merging two
projects into one it is obvious that the resolution of the conflict is
to leave the original version of build.xml
So, I'm removing all conflict markers and removing the incoming line
with the property value=projectOne leaving it as projectTwo.
This effectively means that there is no changes in build.xml for git.
And I'm stuck because i cannot add file, that is not changed and
cannot commit merge results as it is a partial commit.
Is that better;)?
Interesting enough this worked OK on git version 1.6.4.msysgit.0
But giving me headache in git 1.7.0.5 on Linux
Below is command sequence which is supposed to reflect everything above
mkdir test3
mkdir test4
cd test3/
git init
echo file content> file1.java
git add .
git commit -am "initial commit"
echo "<property name=projectname value=test3/>" > build.xml
git add .
git commit -am "add build.xml"
echo "more content" >> file1.java
git commit -am "some change"
cd ../test4
git init
echo file content> file2.java
git add .
git commit -am "initial commit"
echo "<property name=projectname value=test4/>" > build.xml
git add .
git commit -am "add build.xml"
echo "more content" >> file2.java
git commit -am "another change"
git remote add temp ../test3
git fetch temp
git merge temp/master
git status
vi build.xml
git status
git add build.xml
git st
git commit -am "merging"
Thanks,
Eugene
next prev parent reply other threads:[~2010-08-04 23:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-04 20:18 git merge - "both added" conflict resolution Eugene Sajine
2010-08-04 20:59 ` Jonathan Nieder
2010-08-04 23:29 ` Eugene Sajine [this message]
2010-08-04 23:36 ` Jonathan Nieder
2010-08-05 14:41 ` Eugene Sajine
2010-08-06 14:57 ` Eugene Sajine
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='AANLkTi=dScNMsf4XZ+sS8R+424fESyOr6wYO4WamAutj@mail.gmail.com' \
--to=euguess@gmail.com \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).