Jump to content


Distinguishing between manual and automatic merges

integrate resolve merge

  • Please log in to reply
1 reply to this topic

#1 G Barthelemy

G Barthelemy

    Advanced Member

  • Members
  • PipPipPip
  • 65 posts
  • LocationUnited Kingdom

Posted 27 March 2013 - 10:39 AM

In our review process, we would like to emphasise merges that required manual intervention. So take a submitted changelist containing "integrate" revision actions, and for each of those select the file revisions with a "merge from" or  "edit from" integration action.
OK, "edit from" is a straight forward candidate for closer inspection.
The problem is with "merge from" revisions. I read somewhere (on the Perforce site) that 95% of merges are automatic, not sure if that's the case for us but it is certainly a significantly higher percentage than manual merges. We want to distinguish those "merge from" that are the result of a manual merge (for instance those that had conflicting chunks prompting the user to make a choice) from those that were merged automatically by Perforce.

Now I don't want to go into the debate whether blindly letting an automatic merge take its course is always the right thing to do semantically (it isn't of course) and conversely I understand that what could have been an automatic merge may have been forced by the resolver to be manual (although I may be interested to detect those where the user performed a different merge than the automatic option would have done).

Ideally there would be some fstat-query-able flag that would record revisions that were manually created (either plain edits, or manual merges or edit on resolves, that kind of thing). I don't think that exists, does it ?

Alternatively, is there a way that integrations and resolves that would have prompted the user to resolve conflicting chunks be rooted out after the fact (i.e. after the change was submitted) ? How would you go about this ?

Guillaume

#2 P4Sam

P4Sam

    Advanced Member

  • Members
  • PipPipPip
  • 484 posts
  • LocationSan Francisco, CA

Posted 27 March 2013 - 07:00 PM

View PostG Barthelemy, on 27 March 2013 - 10:39 AM, said:

Ideally there would be some fstat-query-able flag that would record revisions that were manually created (either plain edits, or manual merges or edit on resolves, that kind of thing). I don't think that exists, does it ?

Not on fstat, since fstat doesn't show integration records.  You can get this from "p4 filelog" very easily, though; what you're looking for are revisions that either:
  • were "edit" (rather than "integrate")
  • were "edit from" their integration source (rather than "merge from" etc)
The first case indicates a revision where the user reopened it for edit (and may have made manual changes outside of resolve); the second case indicates a revision where the user did manual merging during resolve (which gets recorded as "edit from" rather than a "pure" type such as "merge from" or "copy from" where the content is derived solely from the source).  A "merge from"/"merge into" integration record pair always implies that an automatic merge was done.

This does not tell you whether the user picked a "pure" resolve option that was not suggested, though, e.g. where the user might have chosen to deliberately "copy" or "ignore" when "merge" was the suggested action.  The integration record only stores the outcome, not the exact path to get there (although you can reverse-engineer it by repeating the same integrate with the -C and -h flags and inspecting the resulting resolve).





Also tagged with one or more of these keywords: integrate, resolve, merge

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users