Using patch / diff
Patch/diff are wonderful tools, however people often provide data that confuses them in a messy and difficult to un-tangle sort of a way. Here are some hints on untangling the mess:
- When creating diffs, please use
diff -upN
to create a diff against the revision(s) you checked out.
The options used are:-
-u
- Create unified context diff.
- Chances are much higher that the patch reviewer sees what it is about and is able to apply the patch to code that changed in the meantime. -p
- Show which C function each change is in.
- Just informational, be nice to the patch reviewer. -N
- New file, treat absent files as empty,
- which effectively includes new files in your diff that otherwise would be missing.
- If at all unsure, run patch with --dry-run first, this will appear to do the patching action, but not actually do it [ this can give bogus results with compound inter-depending patches, but is extremely useful ].
- Mostly use patch -p0; 0 signifies the number of path elements to strip from the beginning of the file path the diff points at.
- When you mess up, and have 1/2 of the patch applied and want to revert to clean, either remove the files and cvs update, or re-patch with the '-R' option, to reverse the effect.
- Sometimes using diff between modules with lots of whitespace changes makes the patch hard to read; the '-w' flag to (cvs) diff makes this easier.
Before committing a patch to ooo-build, test it with make patch.apply
in the top-level, NB. it really pays to have 2 copies of the tree - 1 hacked, 1 pristine.
[
edit]
Make clean
Just use dmake clean
in the build/src680
directory. Or for a more descructive version in ooo-build try rm -Rf build
.
[
edit]
CVS setup
In order to make efficient use of bandwidth, generate sensible diffs by default, and follow the trend, you need this in your ~/.cvsrc.
cvs -z3 -q
diff -upN
update -dP
checkout -P
status -v
Reference
http://wiki.services.openoffice.org/wiki/Tips