[p4] Find old dead code?

Roy Smith smith_roy at emc.com
Mon Oct 29 20:08:55 PDT 2007


I want to clean out some old dead code, i.e. blocks which are  
surrounded by

#if 0
[...]
#endif

Finding all the #if 0 lines is easy with grep.  What's a bit more  
complicated is finding all the *old* ones.  Say, older than a year  
(i.e. I'll put up with such sillyness, as long as it's recent; humor  
me on that for the moment).  Perforce certainly has the information  
needed to perform that query, but is there any reasonable way to  
script doing this?

if "p4 annotate" could tag lines with dates instead of change or  
version numbers, that would get me most of the way there, but it  
doesn't seem to be able to do that.

-------------------
Roy Smith <smith_roy at emc.com>
Software Guy, EMC Common Management Group
44 South Broadway, 7th floor
White Plains, NY 10601
(914) 580-3427
AIM: roysmith649



More information about the perforce-user mailing list