#569645 git-core: recursive merge -> recursive conflicts (Could not parse conflict hunks)

Package:
git
Source:
git
Description:
fast, scalable, distributed revision control system
Submitter:
Jonathan Nieder
Date:
2010-09-03 04:48:03 UTC
Severity:
normal
#569645#5
Date:
2010-02-13 05:10:38 UTC
From:
To:
Hi,

I was working on a project with a history like this:

           v1.7.0-rc0 -- v1.7.0-rc1 -- v1.7.0-rc2 -- v1.7.0 [master]
          /                                         /
  v1.6.6.1 -------------------------------- v1.6.6.2 [maint]

v1.6.6.2 and v1.7.0-rc0 made conflicting changes to the file
GIT-VERSION-GEN, which are reconciled in v1.7.0.

On a local branch at v1.7.0-rc2 + some local commits, I merged
v1.6.6.2 and resolved conflicts in GIT-VERSION-GEN.  Then I noticed
v1.7.0, so I tried to merge it.

| $ git merge v1.7.0
| Auto-merging GIT-VERSION-GEN
| CONFLICT (content): Merge conflict in GIT-VERSION-GEN
| error: Could not parse conflict hunks in GIT-VERSION-GEN
| Automatic merge failed; fix conflicts and then commit the result.
| $

I assume this means rerere is confused because the conflict markers
are not in the expected format.

Here is the beginning of the resulting GIT-VERSION-GEN.  There are
no conflict markers in the rest of the file.

| #!/bin/sh
|
| GVF=GIT-VERSION-FILE
| <<<<<<< HEAD
| DEF_VER=v1.6.6.GIT
| |||||||
| <<<<<<< Temporary merge branch 1
| DEF_VER=v1.6.6.GIT
| |||||||
| DEF_VER=v1.6.6.1
| =======
| DEF_VER=v1.6.6.2
| >>>>>>> Temporary merge branch 2
| =======
| DEF_VER=v1.7.0
| >>>>>>> v1.7.0
|
| LF='
| '

~/.gitconfig includes

 [merge] conflictstyle=diff3
 [rerere] enabled

With those settings, this should be reproducible by

 git clone http://smarden.org/git/git.git
 cd git
 git checkout e1e96d1
 git merge a233cc9
 [fix up conflicts]
 git merge v1.7.0

though I have not tried it.

#569645#20
Date:
2010-09-03 04:41:20 UTC
From:
To:
Jonathan Nieder wrote:

Workaround:

	echo '* merge=sane' >>.git/info/attributes
	cat <<-\EOF >>.git/config
	[merge "sane"]
		name = recursive conflict avoider
		driver = " \
			git merge-file --marker-size=%L \
					-L ours -L common -L theirs \
					%A %O %B >%A+ && \
			mv %A+ %A"
		recursive = union
	EOF

This unfortunately forgets the original labels for the files being
merged.