简体   繁体   中英

Git with P4 merge is having issues

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM