www-infrastructure-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Norman Maurer" <nor...@apache.org>
Subject Re: How to supply and apply git diffed patches
Date Tue, 30 Sep 2008 06:48:04 GMT
Hi Gavin,

you need to use "patch -p$number_of_dirs_to_strip". See "man patch" for a
good explanation.
>From manpage:

 -pnum  or  --strip=num
          Strip the smallest prefix containing num leading slashes  from
each
          file  name found in the patch file.  A sequence of one or more
adja‐
          cent slashes is counted as a single slash.  This controls  how
file
          names  found  in  the  patch file are treated, in case you keep
your
          files in a different directory than the  person  who  sent  out
the
          patch.  For example, supposing the file name in the patch file was

             /u/howard/src/blurfl/blurfl.c

          setting -p0 gives the entire file name unmodified, -p1 gives

             u/howard/src/blurfl/blurfl.c

          without the leading slash, -p4 gives

             blurfl/blurfl.c

          and  not specifying -p at all just gives you blurfl.c.  Whatever
you
          end up with is looked for either in the current  directory,  or
the
          directory specified by the -d option.


Cheers,
Norman


2008/9/30 Gavin <gavin@16degrees.com.au>

>
>
> > -----Original Message-----
> > From: David Crossley [mailto:crossley@apache.org]
> > Sent: Tuesday, 30 September 2008 3:34 PM
> > To: infrastructure-dev@apache.org
> > Subject: Re: How to supply and apply git diffed patches
> >
> > Gavin wrote:
> > >
> > > I have absolutely nothing to do with Git, however recently at Forrest
> we
> > are
> > > being supplied with patches which are diffs created using git. The
> paths
> > > seem different and so I haven't tried to apply them, rather cut &
> paste.
> > >
> > > Is there a good way for us to document how to supply git diffed
> patches,
> > and
> > > a goof way for us to implement them using our svn?
> >
> > You need to undertand how to use the 'patch' command's "-p" option.
> > One often receives patches that are like this, not just via git.
> > This strips the appropriate number of leading slashes from
> > file names in the patch.
> >
> > -David
>
> ah, thanks for that, so just use -p all the time then maybe.
>
> I'll try it on the next one.
>
> Gav...
> >
> >
> > --
> > Internal Virus Database is out-of-date.
> > Checked by AVG.
> > Version: 7.5.524 / Virus Database: 270.6.21 - Release Date: 9/11/2008
> > 12:00 AM
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message