开发者

Git with P4 merge is having issues

开发者 https://www.devze.com 2023-01-23 03:31 出处:网络
We have integrated Git with Perforce merge.We invoked the p4merge and it shows 5 conflicts. I resolved only one conflict and saved the merge. When I try to re-invoke the p4merge us开发者_开发知识库ing

We have integrated Git with Perforce merge. We invoked the p4merge and it shows 5 conflicts. I resolved only one conflict and saved the merge. When I try to re-invoke the p4merge us开发者_开发知识库ing gitmerge tool, it says "no merge required." We are not able to reinvoke the mergetool even though the merge is not complete.

Kindly advise.


As Jefromi comments, the question "GIT 2 or more merge conflicts in a single file - how p4merge handles?" points to a possible cause (status 0 even if conflicts exist)

Wrappers can help debug the situation (see some in this gist).
Checking for conflict maker can help you return a non-0 status, like in this script (for emacs, but you can adapt it for other tool)

# 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
0

精彩评论

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