p4 ignores

Synopsis

Displays the ignore mappings computed from the rules in P4IGNORE files.

Syntax

p4 [g-opts] ignores [-v] [path ...]
p4 [g-opts] ignores -i [-v] path ...

Description

It’s not always easy to tell why a file is being ignored during add and reconcile operations. To help with that, p4 ignores lets you see the mappings in Perforce syntax that are applied for any specified path.

If you do not specify a path, the mappings for the current working directory are displayed.

Using the -v option outputs additional information about the source of each set of mappings: the rule that generated them and the line number in the file where the rule is defined.

The -i option checks whether a filepath would be ignored; if it would, the path is returned. With the -v option, a more verbose message is returned explaining whether the filepath would be ignored and if it matched any ignore rules.

Options

-i

Test to see if the specified filepath would be ignored.

-v

Report additional information about the P4IGNORE rules in effect.

When listing mappings, include the rules from which they were generated.

When testing a filepath, include the rule that affected the output.

path

The path to be tested. Specify the path using local syntax.

g-opts

See “Global Options”.

Usage Notes

Can File Arguments Use Revision Specifier? Can File Arguments Use Revision Range? Minimal Access Level Required

No

No

none

Examples

Note that in the following table, the commands in the lefthand column were run in the c:\workspace directory.

p4 ignores

Display a list of mappings generated from P4IGNORE rules.

.../.p4root/...
.../.p4root
.../.p4config/...
.../.p4config
c:/workspace/.../builds/...
c:/workspace/builds/...
c:/workspace/.../builds
c:/workspace/builds

p4 ignores -v

Display a list of mappings generated from P4IGNORE rules, including the rules that they were generated from.

#FILE - defaults
#LINE 2:**/.p4root
.../.p4root/...
.../.p4root
#LINE 1:**/.p4config
.../.p4config/...
.../.p4config
#FILE c:\workspace\.p4ignore
#LINE 1:builds
c:/workspace/.../builds/...
c:/workspace/builds/...
c:/workspace/.../builds
c:/workspace/builds

p4 ignores -i file1 builds/file2

Test to see whether file1 and file2 will be ignored. If a file is ignored, it will be returned. Otherwise, there will be no output.

c:\workspace\builds\file2 ignored

p4 ignores -i -v file1 builds/file2

Test to see whether file1 and file2 will be ignored. If a file is ignored then it will be returned with information about the P4IGNORE rule that it matched. If it is not, it will be returned with a message saying that it is not ignored; if it matched a P4IGNORE exclusionary rule, information about that rule will also be returned.

c:\workspace\file1 not ignored
c:\workspace\builds\file2 ignored by
  c:\workspace\.p4ignore:1:builds