How can WinMerge be used with Perforce Visual Client (P4V)?
Asked Answered
S

1

9

I like using the WinMerge file comparison tool. I'd like to use it with Perforce's P4V tool to be my diff editor.

How can Perforce be configured to allow this?

Squinch answered 5/7, 2016 at 23:50 Comment(0)
S
11

This is possible. Follow these steps:

  1. In the P4V Client, choose: Edit > Preferences
    --> The Preferences dialog appears

  2. In the dialog, in the list on the left, select Diff towards the bottom.

  3. Change the "Default diff application" to be "Other application", then set:

Location:     C:/Program Files (x86)/WinMerge/WinMergeU.exe
Arguments:    /ul /ur /e %1 %2

Per WinMerge's Command-line parameters documentation:

  • /ul prevents WinMerge from adding the left path to the Most Recently Used (MRU) list. External applications should not add paths to the MRU list in the Select Files or Folders dialog.
  • /ur prevents WinMerge from adding the right path to the Most Recently Used (MRU) list. External applications should not add paths to the MRU list in the Select Files or Folders dialog.
  • /e enables you to close WinMerge with a single Esc key press. This is useful when you use WinMerge as an external compare application: you can close WinMerge quickly, like a dialog. Without this parameter, you might have to press Esc multiple times to close all its windows.

Perforce Preferences dialog

There is documentation on the WinMerge site that describes how to set it up to work with Visual Studio, SVN and Visual Source Safe, too.

Squinch answered 5/7, 2016 at 23:50 Comment(3)
That description is how to diff, not how to merge. What are the arguments to use for merging? (Merge is one entry down from the selected Diff entry)Stonedeaf
@Stonedeaf - you are right. I've updated the question to indicate that I wanted diff, not merge. The tag I used was 'diff'. That being said, see manual.winmerge.org/en/Command_line.html for all the flags that can be used (including those to do a merge).Squinch
That documentation is incomplete. However, the WinMerge author currently doesn't recommend it for 3-way merges: github.com/WinMerge/winmerge/issues/660Kazbek

© 2022 - 2024 — McMap. All rights reserved.