Git 产生“BUG:存在未合并的索引条目”

发布于 2024-11-25 11:39:52 字数 2072 浏览 1 评论 0原文

执行时:

git merge some-branch

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

不确定这意味着什么,但它看起来比通常更出乎意料。我该怎么办?有一些清理命令可以帮助我吗?

编辑

更糟糕的是,这个错误实际上沿着我的源版本之一传播。由于 some-branch 原本只是我本地的工作,所以我将其推送到远程服务器上。然后克隆一个新的存储库并尝试合并此副本上的上述分支并得到相同的消息。

编辑2

我使用了 GIT_MERGE_VERBOSITY=5 并得到:

$> 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

注意:我最近将我的目录之一移到了一个单独的子模块中。现在我因此遇到了很多冲突。看来这个错误与此有关。

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:

gt; 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

懒的傷心 2024-12-02 11:39:52

该错误消息是 2010 年 1 月引入,为了帮助调试此案例,Junio C. Hamano 建议设置GIT_MERGE_VERBOSITY 到 5:

我们可能建议用户将GIT_MERGE_VERBOSITY设置为5,并在消息中重新运行合并。
至少我们会知道 process_renames()process_entry() 函数的哪一部分没有正确处理未合并的路径,这可能有助于我们诊断问题。

OP julkiewicz 报告

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

允许隔离导致此错误消息的目录。

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.

翻身的咸鱼 2024-12-02 11:39:52

我刚刚删除了当前签出中的 doc/(冲突文件夹)并重新运行合并。遇到了一些冲突,但是这次没有错误。

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.

小姐丶请自重 2024-12-02 11:39:52

当我遇到此错误时,关闭重命名检测对我有用。

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

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

git merge --no-ff -s recursive -X no-renames <branchToMerge>
墨洒年华 2024-12-02 11:39:52

以防万一这对某人有帮助,因为解决方案也是改变策略:

git merge -s ours

基础分支很久以前就转移了,不可能进行变基,所以这解决了我的更改带来的问题分支,同时保留当前分支上的内容。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文