1

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.

user298800
  • 421
  • 1
  • 4
  • 5
  • Did you perhaps prematurely tell git the other conflicts were resolved, by running `git add `? I could see that being really easy to accidentally do if there were multiple conflicts in one file and you only resolved one... – Cascabel Nov 01 '10 at 13:33
  • Perhaps this question has your answer? [git: two or more merge conflicts in a single file with p4merge](http://stackoverflow.com/questions/4067202/git-2-or-more-merge-conflicts-in-a-single-file-how-p4merge-handles) – Cascabel Nov 01 '10 at 13:36

1 Answers1

0

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
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250