1

I have a list of ignore rules in a p4ignore.txt per http://www.perforce.com/perforce/doc.current/manuals/cmdref/env.P4IGNORE.html

I would like to list the files in my workspace matched by the ignore rules. How can I do that?

(In Git, this is easy https://stackoverflow.com/a/2196755/284795 )

As I understand p4 status lists files in the workspace that either

  1. exists in the repository (depot) and differ from it
  2. don't exist in the repository and aren't matched by the ignore rules

I would like to list files in the workspace that are matched by the ignore rules, whether they exist in the repo or not.

Community
  • 1
  • 1
Colonel Panic
  • 132,665
  • 89
  • 401
  • 465

1 Answers1

3

If p4 status is already returning no files, you can use p4 reconcile -I to see what would be added if the ignore rules aren't used.

If p4 status is returning files already, but you'd still like to see the difference, you can run it once with and once without -I and diff the two.

p4 reconcile -n ... > /tmp/foo
p4 reconcile -nI ... > /tmp/foo2
diff /tmp/foo /tmp/foo2
gaige
  • 17,263
  • 6
  • 57
  • 68
  • Thanks. Will these list files matched by the rules that also exist in the repository? That's what I'm really interested in—I'm concerned my rules are too wide. – Colonel Panic Jul 22 '13 at 10:46
  • These will only show things that are not currently in the repository. `p4 reconcile -n` is the equivalent of `p4 status` and gives you the list of items that are not equivalent in the repository (need to be added, edited, or deleted). Adding the '-I' just adds in the items that would otherwise be ignored. Anything up-to-date in the repository won't show up in either list. – gaige Jul 22 '13 at 12:22