Previous: Diff Line Filter, Up: Patch Generation


4.3.4 Diff Prologue

Patcher can (and does) insert a special prologue just above a patch in the message in preparation. This prologue gives information such as the diff command used, the files affected and so on.

The function used to generate this prologue can be specified with the :diff-prologue-function project option. A value of nil means don't insert any prologue. By default, the internal function patcher-default-diff-prologue is used. If you want to provide your own, here's how to do it.

Your function should take two mandatory arguments: name and kind. name is the name of the project and kind is the kind of diff. Possible values for the kind argument are:

:sources
indicates a source diff only,
:change-logs
indicates a ChangeLog diff only,
:mixed
indicates a diff on both source and ChangeLog files.

Your function should also accept the following set of Common Lisp style keyword arguments (take a look at the provided function if you don't know how to do this). These arguments will be bound when appropriate, according to the kind of diff being performed.

source-diff
the command used to create a source diff,
change-log-diff
the command used to create a ChangeLog diff,
source-files
sources files affected by the current patch,
change-log-files
ChangeLog files affected by the current patch.

In the case of a mixed diff, a nil value for change-log-diff indicates that the same command was used for both the source and ChangeLog files.

Finally, your function should perform insertion at the current point in the current buffer.