Re: git merge - "both added" conflict resolution

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 4, 2010 at 4:59 PM, Jonathan Nieder <jrnieder@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]