This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [OT] patches, was Re: [using gcc book] compound literals


On Tue, 26 Aug 2003, Chris Devers wrote:
> I sent a mail to Gerald Pfeifer (as he was the person that pointed me
> towards the -u3p switches for `diff`), but the editor at FSF that I'm
> working with indicated that he may be in Austria, so it may be off-hours
> for him to reply at this point.

Well, it past midnight, but the "evil never sleeps". ;-)

> May I ask for a step by step overview of how the diff/patch cycle is
> typically done?

Typically, one checks out a tree from (the desired branch in) CVS and
makes his modifications there.  A regular `cvs update` will merge in
changes that have been made to the branch in CVS in the meantime and
automatically detect and flag conflicts (i.e., instances where your
changes and the changes others made and committed to CVS were to the
same lines in the text and not exactly the same).

> I want to merge those changes into what I'm working on, then come up with
> a diff of my changes that would be suitable for submission to the list for
> review. With that in mind, I assume the process is:
>
>   1.   diff the custom edit against current a CVS checkout

This may be the problem!  You need to diff your edited version against
the version in CVS it is based on (not a current CVS checkout).

> Sound about right?

The rest of the procedure sounds right, though instead of "patch my
version against CVS" you should do a "cvs update".

>   * run all diffs
>
>         for texi in *texi
>         do
>             diff -u3p ../gcc/gcc/doc/$texi $texi > \
>                 ../diffs/$texi.diff
>         done

Okay, provided that ../gcc/gcc/doc/$texi contains the sources at the
time you started working on your changes.  If it doesn't, your best bet
is to try to reconstruct that state of history (by means of the -D option
of "cvs update").

>   * patch each file
>
>         for texi in *texi
>         do
>             patch -i ../diffs/$texi.diff $texi
>         done

My man page for patch has the following invocation
  patch [options] [origfile [patchfile]]
that is, you should revert the order of the two filenames. However, most
of the time
  patch < ../diffs/$texi.diff
should be sufficient.

> (I'm primarily working on a Mac, but I believe that the
>  system has standard versions of all the relevant tools:

You are more up-to-date than the system I regularily use to contribute
patches. ;-)

Concerning scripts, I personally don't use any for this task, but usually
use the following sequence.

 % cvs checkout ...
 % [some time later]
 % cvs update
 % [make changes and test them, possibly over the period of several weeks]
 % cvs update  [to merge in changes that have been made in the meantime]
 % [test again]
 % cvs diff ... [basically what your script does]
 % [submit patch to gcc-patches, and wait for responses, possible iterate
    the previous steps]
 % cvs commit

Gerald
-- 
Gerald Pfeifer (Jerry)   gerald@pfeifer.com   http://www.pfeifer.com/gerald/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]