1

I would like to compare two p4 files from command line without it opening diff dialogI'm using p4vc

Command: "p4vc diff fileA#1 fileB#2"

This initially opens diff dialog box asking to confirm the files and versions and when I click Diff, it then shows the differences. Is there any way to bypass or skip this intermediate step?

I know I can use other diff tools as default but would prefer to use inbuilt p4 diff tool. Is there anyway to force diff or option to not show the dialog?

Bhuvan
  • 21
  • 5

2 Answers2

1

You can use the p4 command line client if you want to use Perforce's built-in diff logic and don't want to see any UI:

p4 diff2 fileA#1 fileB#2
Samwise
  • 68,105
  • 3
  • 30
  • 44
  • I want to see the differences in the diff tool without another prompt asking me to confirm the files to compare. Command line diff is not very readable/flexible when comparing huge files – Bhuvan Mar 06 '19 at 16:52
  • Check out this thread on forums.perforce.com, sounds like someone else has a similar need and they gave a few more details: https://forums.perforce.com/index.php?/topic/5990-bypass-dialog-during-p4vc-diff/#entry24535 – Samwise Mar 06 '19 at 17:46
  • That is posted by me :) – Bhuvan Mar 06 '19 at 19:22
0

I couldn't find a better way to bypass the dialog box using p4vc. From the response I received from perforce forum https://forums.perforce.com/index.php?/topic/5990-bypass-dialog-during-p4vc-diff/, a user suggested using p4merge.

Steps:

  • p4 print -o fA fileA#1

  • p4 print -o fB fileB#2

  • p4merge fA fB

This will bring up the p4 diff tool for comparison. The limitation with p4merge is that it can only compare local files which requires the p4 files to be printed into local files and compare them. Network bandwidth can cause slight delays fetching the files from p4.

Bhuvan
  • 21
  • 5