I can't find the guide that I mentioned on IRC, but those looking for tips on better use of diff and patch may find them in this book "Comparing and Merging Files with GNU diff and patch" by David MacKenzie, Paul Eggert, and Richard Stallman http://www.network-theory.co.uk/docs/diff/Overview.html My most frequent commands are: 1. # generating a patch of changes to one file cp file file.orig edit file diff -u file.orig file | tee file.patch 2. # generating a patch of all changes in a directory diff -ruN dir.orig dir.mod > all-changes-in-dir.patch 3. # applying a patch to a file patch file < file.patch 4. # applying a patch to a directory cd dir patch -p1 < /tmp/all-changes-in-dir.patch 5. # reversing that patch out again when it doesn't work cd dir patch -Rp1 < /tmp/all-changes-in-dir.patch There are some handy cvs diff commands: 1. cvs diff -u file # changes since last commit 2. cvs diff -r1.1 -r1.2 -u file # changes between given revisions and with git: 1. git diff -u file # changes since last commit 2. git diff -u rel22 master file # changes between given branches This can also give a crude way to reverse a change: use diff to make a patch file and then feed it to patch -R... but there are usually better ways. cvs update's merge options and git revert. If you are using patch files without revision control much, you may find wiggle helpful: http://cgi.cse.unsw.edu.au/%7Eneilb/source/wiggle/ Ask questions and I'll try to answer. Mangling files is one thing I have had far too much practice at! Hope that helps someone, -- MJ Ray - see/vidu http://mjr.towers.org.uk/email.html Webmaster/web developer, statistician, sysadmin, online shop maker, developer of koha, debian, gobo, gnustep, various mail and web s/w. Workers co-op @ Weston-super-Mare, Somerset http://www.ttllp.co.uk/
Well, I've never done it before, but with this encouragement, I'll submit my first patch. Currently when running bulkmarcimport if both the testing flag and delete flag are given, all the bib records are still deleted. Someone might be very surprised to find all their bib records gone if they were only testing the script! This patch keeps from deleting bib files if the testing parameter is present. Please let me know if you agree that the new behavior makes sense. Is this what the patch should look like? --Jason
participants (2)
-
Jason Ronallo -
MJ Ray