[p4] Patching files checked out from Perforce with no questionsasked

Jeff Grills jgrills at junctionpoint.com
Wed Nov 1 14:10:53 PST 2006

It looks like patch(1) understands something about version control software
now.  I don't ever remember seeing this before, so it might be a relatively
new enhancement.  Here's an excerpt from a patch(1) man page:

       -g num  or  --get=num
          This  option  controls  patch's  actions when a file is under RCS
          SCCS control, and does not exist or is  read-only  and  matches
          default  version, or when a file is under ClearCase or Perforce
          and does not exist.  If num is positive, patch gets (or  checks
          out)  the  file  from  the  revision  control system; if zero,
          ignores RCS, ClearCase, Perforce, and SCCS  and  does  not  get
          file;  and if negative, patch asks the user whether to get the
          The default value of this option  is  given  by  the  value  of
          PATCH_GET  environment  variable  if  it is set; if not, the
          value is zero if patch is conforming to POSIX, negative otherwise.

So, you might just need to specify "-g 0" to patch to make it stop harassing


> -----Original Message-----
> From: perforce-user-bounces at perforce.com 
> [mailto:perforce-user-bounces at perforce.com] On Behalf Of Geir 
> A. Myrestrand
> Sent: Wednesday, November 01, 2006 10:57 AM
> To: perforce-user at perforce.com
> Subject: [p4] Patching files checked out from Perforce with 
> no questionsasked
> Upon applying a rather large patch set on files checked out 
> from Perforce, I am presented with this question for every 
> file modified by the patch set:
> Get file <filename_modified_by_patch_set> from Perforce with lock? [y]
> The desired behavior is no, but I don't want to answer this 
> question for each file in the patch set --I want no for all, 
> without the interactive portion.
> How can I achieve this?
> I mean, is there an environment variable or Perforce setting 
> I can use to change this behavior?
> P4CLIENT, P4USER, and P4PORT are set, and I am using the p4 
> command line client on RHELAS4. The Perforce server is 2004.2/72935.
> -- 
> Geir A. Myrestrand

More information about the perforce-user mailing list