37 messages in com.perforce.perforce-userRemoving unchanged files from changel...
FromSent OnAttachments
Kend...@scitechsoft.com15 Jun 1999 16:26 
Raju...@commerceone.com15 Jun 1999 16:27 
Raju...@commerceone.com15 Jun 1999 16:34 
Scot...@seaslug.org15 Jun 1999 16:40 
Stev...@Eng.Sun.COM15 Jun 1999 16:43 
Jeff...@nextcard.com15 Jun 1999 16:56 
Kend...@scitechsoft.com15 Jun 1999 17:05 
Kend...@scitechsoft.com15 Jun 1999 17:05 
Stev...@eng.sun.com15 Jun 1999 17:52 
Fred...@mydata.se15 Jun 1999 18:03 
Raym...@orion.no16 Jun 1999 01:47 
Scot...@seaslug.org17 Jun 1999 12:04 
Scot...@seaslug.org17 Jun 1999 12:04 
Greg...@acm.org17 Jun 1999 12:16 
Greg...@acm.org17 Jun 1999 12:16 
Jeff...@nextcard.com17 Jun 1999 12:35 
Jeff...@nextcard.com17 Jun 1999 12:35 
Scot...@seaslug.org17 Jun 1999 12:36 
Scot...@seaslug.org17 Jun 1999 12:36 
Kend...@scitechsoft.com17 Jun 1999 12:46 
Kend...@scitechsoft.com17 Jun 1999 12:46 
Kend...@scitechsoft.com17 Jun 1999 12:46 
Kend...@scitechsoft.com17 Jun 1999 12:46 
Scot...@seaslug.org17 Jun 1999 12:49 
Scot...@seaslug.org17 Jun 1999 12:49 
PatH...@marketguide.com17 Jun 1999 12:50 
PatH...@marketguide.com17 Jun 1999 12:50 
Paul...@sam.engr.sgi.com17 Jun 1999 13:06 
Paul...@sam.engr.sgi.com17 Jun 1999 13:06 
Raju...@commerceone.com17 Jun 1999 13:31 
Raju...@commerceone.com17 Jun 1999 13:31 
Raym...@orion.no18 Jun 1999 01:36 
Raym...@orion.no18 Jun 1999 01:36 
Kend...@scitechsoft.com19 Jun 1999 12:05 
Kend...@scitechsoft.com19 Jun 1999 12:05 
Kend...@scitechsoft.com19 Jun 1999 12:05 
Kend...@scitechsoft.com19 Jun 1999 12:05 
Subject:Removing unchanged files from changelist?
From:Scot...@seaslug.org (Scot@seaslug.org)
Date:06/15/1999 04:40:15 PM
List:com.perforce.perforce-user

"Kendall Bennett" <KendallB at scitechsoft.com> wrote:

Steve Cogorno <Steven.Cogorno at Eng.Sun.COM> wrote:

p4 diff -sr | p4 -x - revert

Ok, this works like a charm!

Now is there some way to do something similar to run 'grep' over all changed files, looking for a particular string? Specifically I want to check for hard coded debug interrupts (DebugInt() is our macro for this) in the code before any submissions are made.

How about this:

p4 diff -sa | xargs grep DebugInt /dev/null

along with some explanation...

1) Do 'p4 help diff' to see what the '-sa' switch does.

2) Use 'xargs' (on Unix or Unix-like toolsets elsewhere) to bundle up command args for [possibly] multiple invocations of the given command (see 'man xargs').

3) Give 'grep' an initial filename of '/dev/null' to make sure that it always has at least 2 filenames on its command line. That way, it will be sure to always include the filename prefix on each of its output lines. Otherwise, if you end up with a 'grep' invocation that got only one filename, [most?] greps would leave the filename prefix off of the output.

And, if you want to restrict things to particular types of filenames, try something like this:

p4 diff -sa //.../%1.c | xargs grep DebugInt /dev/null

or whatever...the general idea being to use Perforce filemasking to restrict the set of files that 'p4 diff' operates over.

Scott.Blachowicz at seaslug.org