From: Brian G. P. <br...@br...> - 2005-03-24 14:34:59
|
On Wednesday 23 March 2005 03:35 pm, Richard Cyganiak wrote: > By the way, I have a dumb question: How do I apply such a diff output > automatically to a file? Something with the patch command I believe, > but I couldn't get it to work. if your diff file is named 'tagspatch.diff' you would do: patch < tagspatch.diff to apply the patch. Generally, this works best when the diff is against only a small number of files, and if the diff is a 'unitified' diff. diff -u3 origfile changedfile >> filename.patch The -u3 parameter to diff is very important, because it creates a 'unified' diff with several lines of context. This allows the patch program to find where to insert the changed lines, even if the file has changed slightly since the patch was generated. Regards, - Brian |