Calmbach, Richard wrote:
This is from the issue "Clearer forrestbot documentation"
(http://issues.apache.org/jira/browse/FOR-568):
Comment by Ross Gardler [14/Dec/05 12:16 PM]:
> Please note that the diff was incorrectly made. It was against a file
called
> forrest.xml.orig and therefore could not be applied without manual
interention.
I want to learn how to do this right. I should mention that even though
the patch is against SVN HEAD, I did not use Subversion to check out the
sources (I haven't installed Subversion yet), I simply downloaded
forrestbot.xml via the ViewCVS web interface. I figured the closest
match to my situation were the instructions for users of a downloaded
released version of Forrest
(http://forrest.apache.org/contrib.html#patch), hence the .orig.
If you don't have SVN then you did a pretty good job :-)
By far the easiest way of creating a patch, both for yourself and for
the dev applygin it is to use SVN. It takes a short while to install SVN
and will save you lots of time in the future.
Basically, before starting on a problem you would then do:
svn up - to make sure you are up to date
do your editing
svn up - to make sure there are no conflicts between your edits and
those of others in the interim
svn status - to list the files that have changed and how
svn add ... - to add any new files you have created
Finally to actually create the patch :
svn diff . > patch_description.diff
I experimented a bit with patch (I used GNU patch 2.5.4): Even if the
input file is "forrestbot.xml", doing "patch < forrestbot.xml.diff2"
successfully applies the patch to that file and the output is still
named "forrestbot.xml".
Didn't work for me, perhaps because I am in the habit of doing 'patch
-p0 <forrestbot.xml.diff2'
Even if that doesn't work, isn't it just a matter of "patch
forrestbot.xml forrestbot.xml.diff2"?
Yes, but we try and keep everything as simple as possible for the devs.
You see if it takes 1 minute to apply a patch we are likely to do it. If
it takes 5 minutes to work out what we need to patch and how we are less
likely to do it.
In order to know the above command one would have to look inside the
patch, work out which files have been patched and type a long command.
Furthermrore, if there are more than one files patched, that's alot of
commands.
What we really want is a patch that is made from the root of the project
so all we need to do is review the patch as a text file then cd
FORREST_HOME and 'patch -p0 < patch_description.diff'
What is the recommended procedure? (Other than "Install Subversion!",
which I will do - it's on my list :-).
Errr.. install subversion ;-)
Your approach above would not work well at all if you were editing a
number of files.
----
Anyway, thank you very much for your patch. We would rather see patches
like yours than not see them at all. We are, of course, very grateful
for your contribution and are happy to "repay" you with assistance with
SVN if you hit any difficulties.
Ross