与P4合并的Git存在问题

时间:2010-11-01 12:45:08

标签: git merge

我们已将Git与Perforce合并整合。我们调用了p4merge,它显示了5个冲突。我只解决了一个冲突并保存了合并。当我尝试使用gitmerge工具重新调用p4merge时,它说“不需要合并”。即使合并未完成,我们也无法重新调用mergetool。

请告知。

1 个答案:

答案 0 :(得分:0)

作为Jefromi comments,问题“GIT 2 or more merge conflicts in a single file - how p4merge handles?”指出可能的原因(即使存在冲突,状态为0)

Wrappers可以帮助调试情况(see some in this gist) 检查冲突制造商可以帮助您返回非0状态like in this script(对于emacs,但您可以将其调整为其他工具)

# check modified file
if [ ! $(egrep -c '^(<<<<<<<|=======|>>>>>>>|####### Ancestor)' ${_MERGED}) = 0 ]; then
  _MERGEDSAVE=$(${_MKTEMP} --tmpdir `${_BASENAME} ${_MERGED}`.XXXXXXXXXX)
  ${_CP} ${_MERGED} ${_MERGEDSAVE}
  echo 1>&2 "Oops! Conflict markers detected in $_MERGED."
  echo 1>&2 "Saved your changes to ${_MERGEDSAVE}"
  echo 1>&2 "Exiting with code 1."
  exit 1
fi