Jump to content


P4V - about p4diff command line options

P4V p4 diff

  • Please log in to reply
3 replies to this topic

#1 mister_wilson

mister_wilson

    Advanced Member

  • Members
  • PipPipPip
  • 114 posts
  • LocationMontreal, Quebec

Posted 26 April 2019 - 07:18 PM

Hi,


I have a file //mydepot/mybranch/myfile.txt opened for edit with just a single whitespace change.
When I run the command
p4 diff -sr //mydepot/mybranch/...
it returns nothing because myfile.txt has been changed with a white space..

But if I include the options -db -dw -dl, perforce still returns nothing. It seems that these options are not compatible with -sr.

i.e.: p4 diff -db -dw -dl -sr //mydepot/mybranch/...

Is there a way that I can return the list of unchanged files from perforce ignoring all whitespace changes?

Thanks,

-Jonathan Wilson

P.S. I'm using P4V on Windows 10 Rev. P4V/NTX64/2018.4/1753667


Command line version:
F:\P4\mywork>p4 -V
Perforce - The Fast Software Configuration Management System.
Copyright 1995-2019 Perforce Software.  All rights reserved.
This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.openssl.org/)
Version of OpenSSL Libraries: OpenSSL 1.0.2q  20 Nov 2018
See 'p4 help [ -l ] legal' for additional license information on
these licenses and others.
Extensions/scripting support built-in.
Parallel sync threading built-in.
Rev. P4/NTX64/2018.2/1751184 (2019/01/21).

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 800 posts

Posted 26 April 2019 - 08:22 PM

I can't think of an easy one-shot for it.  The "-s" options completely ignore the "-d" diff flags because they don't do a real diff, they just compare the checksums (which include all the whitespace)

The way to script it would probably be something like "p4 diff -q -Od -dw", which I think will get you just the filenames of the differing files -- then you can take that output and diff that versus "p4 diff -q".  I think?

The theory behind that "-O" flag on diff was that we'd be able to add other sub-flags there to accommodate use cases like this where you want to run the normal diff logic but filter the output in different ways; a hypothetical "p4 diff -Os" ("output same") would be exactly the thing for this use case if it existed, but I don't think it does yet.

#3 mister_wilson

mister_wilson

    Advanced Member

  • Members
  • PipPipPip
  • 114 posts
  • LocationMontreal, Quebec

Posted 26 April 2019 - 08:29 PM

Hi Sam,

There is no -q option for p4 diff. Did you mean 'p4 diff2' instead where -q is a valid option?

#4 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 800 posts

Posted 26 April 2019 - 08:49 PM

Hm, I thought there was a -q option on there to suppress the actual text, but I guess not.  Another good enhancement request!  Not too hard to fake with a "grep"...





Also tagged with one or more of these keywords: P4V, p4 diff

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users