开发者

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.


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.


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.


Turning off rename detection worked for me when I encountered this error.

git merge --no-ff -s recursive -X no-renames <branchToMerge>


Just in case this helps someone, for the the solution was to change the strategy as well:

git merge -s ours

The base branch had diverted way too long ago and a rebase was not possible, so this solved the issue bringing the changes from my branch while keeping what was on the current branch.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜