[ofw] [PATCH 3/7] docs/generating patches

Sean Hefty sean.hefty at intel.com
Thu May 15 15:58:40 PDT 2008


The SVN diff program cannot handle generating diffs between two different
directories.  This file describes how to use an external diff program
to generate patches between two directories that can then be applied.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
Maybe this is a limitation of my svn diff program, but I tried two
different svn clients, and neither could provide diff output between a
branch and the trunk.  I used GnuWin32 utilities for patch generation
using the process described by this document.

Index: generate-patch.txt
===================================================================
--- generate-patch.txt	(revision 0)
+++ generate-patch.txt	(revision 0)
@@ -0,0 +1,18 @@
+Patches can be generated using the 'svn diff' utility if the changes are
+limited to a single branch in the svn tree.  However, to generate a patch
+by comparing two branches using a 'diff' program (e.g. GnuWin32 'diff'),
+the following syntax will help produce patches that are more easily
+reviewable:
+
+diff -up -r -X docs\dontdiff.txt -I \$Id: old_path new_path
+
+For full diff syntax information, see the diff documentation, but as a summary:
+
+-u  provides a unified diff (includes lines around changed lines for context)
+ p  lists the C function name containing the diff
+-r  does a recursive diff (use when old_path and new_path are directories)
+-X  excludes files listed in docs\dontdiff from the diff
+-I  ignores diffs caused by the SVN Id line
+
+Patches generated using this method can be applied by using a 'patch' program,
+such as GnuWin32 'patch'.
\ No newline at end of file





More information about the ofw mailing list