2

Would like to know how can I grep information in depot deleted files. At first, I found that perforce supports searching file contents like so:

p4 grep -i -n -e "infoSearch" //depot/alex/moreStuff/...

from testing it seems that with the command above it won't search the "deleted" files of the provided location above. P4 help page won't give me much info on how can I do it either. (p4 grep)

Wondering how can I do it then ? Maybe I've missed something or do not understand..

Environment used:

  • Linux OS, command line interface;
  • Perforce version used: Perforce Visual Client/LINUX26X86_64/2013.4/760166
neaAlex
  • 206
  • 3
  • 15
  • oh, and without syncing whatsoever...I know it can be a workaround to just p4 sync stuff before actual delete of a file / folder, but these means additional troublesome steps in my case :( – neaAlex May 18 '20 at 08:50

1 Answers1

3

Did you try the -a option?

        The -a flag searches all revisions within the specified range. By
        default only the highest revision in the range is searched.

Remember that a deleted file is just a file with a deleted revision at #head; all the old revisions are still there! The only reason p4 grep doesn't search them by default is that by default it only operates on the head revision.

Samwise
  • 68,105
  • 3
  • 30
  • 44