Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git produces "BUG: There are unmerged index entries"

When doing:

git merge some-branch

I get

BUG: There are unmerged index entries:
BUG: 3 docfatal: Bug in merge-recursive.c

Not sure what this means, but it looks like something more unexpected then usually. What am I supposed to do with this? Is there some clean up command that could help me here?

EDIT

What is worse, this bug actually spreads along one of the versions of my source. As some-branch was originally just my local work, I pushed it onto the remote server. Then cloned a fresh repository and tried to merge the aforementioned branch on this copy and got the same message.

EDIT 2

I used GIT_MERGE_VERBOSITY=5 and got:

$> export GIT_MERGE_VERBOSITY=5; git merge origin/funkload 
Merging:
a1ef5a2 Uaktualniony INSTALL.
virtual origin/funkload
found 2 common ancestor(s):
d2eb442 Resources py.
119871b Nowy commit w doc.
  Merging:
  d2eb442 Resources py.
  119871b Nowy commit w doc.
  found 1 common ancestor(s):
  62f4183 Poprawiony bug w obsłudze linków do resources, które są null.
  Removing doc/concept/agreement.lyx
  Removing doc/concept/agreement.pdf
  Removing doc/concept/concept.lyx
  ...
  Removing druglo-doc
  Removing src/db/fixtures/initial.json
  Skipped src/druglo/backend/actions/tests/fight.py (merged same as existing)
  Auto-merging src/druglo/backend/characters/models/behaviours.py
  CONFLICT (content): Merge conflict in src/druglo/backend/characters/models/behaviours.py
  Auto-merging src/druglo/backend/players/models/players.py
  Auto-merging src/druglo/backend/worlds/resources.py
  CONFLICT (content): Merge conflict in src/druglo/backend/worlds/resources.py
  Auto-merging src/druglo/common/integrity/webservices/resources.py
  CONFLICT (content): Merge conflict in src/druglo/common/integrity/webservices/resources.py
  Removing src/druglo/frontend/cityscreen/models.py
  Removing src/druglo/frontend/forms.py
  Removing src/druglo/frontend/mainscreen/models.py
  Removing src/druglo/frontend/models.py
  CONFLICT (directory/file): There is a directory with name doc in Temporary merge branch 1. Adding doc as doc~Temporary merge branch 2
BUG: There are unmerged index entries:
BUG: 3 docfatal: Bug in merge-recursive.c

Note: I've recently moved one of my directories into a separate submodule. Now I get a lot of conflicts because of that. It seems the bug is related to that.

like image 521
julx Avatar asked Jul 20 '11 11:07

julx


2 Answers

That error message was introduced in January 2010, and to help debug this case, Junio C. Hamano recommends settings GIT_MERGE_VERBOSITY to 5:

We might want to suggest the user to set GIT_MERGE_VERBOSITY to 5 and re-run the merge in the message.
At least we will know which part of process_renames() or process_entry() functions is not correctly handling the unmerged paths, and it might help us diagnosing the issue.

The OP julkiewicz reports

CONFLICT (directory/file): 
There is a directory with name doc in Temporary merge branch 1. 
Adding doc as doc~Temporary merge branch 2

which allowed for isolating the directory causing this error message.

like image 71
VonC Avatar answered Oct 18 '22 18:10

VonC


I've just removed the doc/ (the conflicting folder) in the current checkout and re-run the merge. Got some conflicts but, no bugs this time.

like image 41
julx Avatar answered Oct 18 '22 18:10

julx