I use Slickedit to work with the Linux kernel. As such, most code changes are handled in the form of patch files, like this one:
diff --git a/drivers/char/viocons.c b/drivers/char/viocons.c
index a362ee9..6d2e314 100644
--- a/drivers/char/viocons.c
+++ b/drivers/char/viocons.c
@@ -947,7 +947,7 @@ #ifdef CONFIG_MAGIC_SYSRQ
*/
continue;
} else if (vio_sysrq_pressed) {
- handle_sysrq(cevent->data[index], NULL, tty);
+ handle_sysrq(cevent->data[index], tty);
vio_sysrq_pressed = 0;
/*
* continue because we don't want to add
--
1.4.2.1
Each block of changes is called a 'hunk'. Part of the problem with patchfiles is that if the original code has been updated since the patch was created, but before the patch is applied, some hunks may not apply. The end result is a file that's been changed partially, but an number of hunks left behind.
What makes this procedure even more difficult is that the tools that are normally used don't make it easy to deal with partial patching. The developer usually has no choice but to manually apply patches, one line at a time, using cut and paste.
Slickedit's diffzilla is an amazing tool, and I would like to see it extended to handling patch files. Specifically:
1) To start the patch application, I specify a source file and patch file. Diffzilla opens two windows as normal. Ideally, I should be able to just specify the patchfile, and diffzilla will find the right source file for me.
2) In the 2nd window is the patch file, broken down into a sequence of hunks. If a hunk can be applied easily (i.e. diffzilla can identify where it's supposed to go), then that hunk can be applied with a single mouse click.
3) If a hunk can't be applied, I can use the editing tools of diffzilla to easily copy over single lines and/or edit the source file as I normally can in diffzilla. Editing the patch file probably wouldn't be useful.
4) If I have to manually apply a hunk, then afterwards I can mark that hunk in the original patchfile as being applied.
5) After I'm done, diffzilla will give me the option of creating a new patchfile in case I had to make manual edits.
For now, being able to do this with a single source file and a single patch file would be great. However, a single patch file can contain hunks for multiple source files, so diffzilla should be able to handle that somehow. A later version would be able to handle multiple patch files as one group.