'\" t .\" aegis - project change supervisor .\" Copyright (C) 2001-2004, 2006-2008 Peter Miller .\" .\" This program is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 3 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see .\" . .\" .so z_name.so .ds n) aepatch .TH "aepatch" 1 \*(N) "Reference Manual" "" .SH NAME \*(n) \- send and receive changes as patches .XX "aepatch(1)" "send and receive changes as patches" .SH SYNOPSIS .B \*(n) .B \-send [ .IR option ... ] .br .B \*(n) .B \-receive [ .IR option ... ] .br .B \*(n) .B \-list [ .IR option ... ] .br .B \*(n) .B -Help .br .B \*(n) .B -VERSion .SH DESCRIPTION The .I "\*(n)" command is used to send Aegis changes as patches, or receive patches and turn them into Aegis changes. .PP Please note that this only works for text files. If your project uses binary files, the \fI\*(n)\fP program will not be useful because the \fIdiff\fP(1) and \fIpatch\fP(1) commands only work on text files. Also, this only works for files with names which do not contain white space. .PP If you need to merge matches together, you could use the GNU patch utils, which include a tool to merge patches together. .SH SEND The send variant takes a specified change and constructs a patch containing all of the changes to all of the files in that change. The result is compressed, and encoded into a text format which can be sent as e-mail without being corrupted by the mail transfer agents along the way. .PP The output of the \fIaepatch -send\fP command is a normal Unix patch, as you would produce using \fIdiff\fP(1), \fIbzip2\fP(1) and a MIME encoder such as \fImpack\fP(1). There are no special formats. The output can be uncompressed with the normal \fIbunzip2\fP(1) command and applied with the normal \fIpatch\fP(1) command. .PP The compression algorithm is selectable via the \fB\-compression-algorithm\fP option, see the OPTIONS section, below, for details. The \fB\-compatibility\fP option also understands compression needs. .SS Generating Traditional Patches If you wish to send "traditional" patches to developers who are not using Aegis to manage the sources at their end, you can use the following options: .RS .ft CW aepatch -send -cte=none -comp-alg=none .ft R .RE This says to use no Content Transfer Encoding, and no compression. If you wish to also omit the Aegis meta data, you can use the following options: .RS .ft CW aepatch -send -cte=none -nocomp -compat=4.16 .ft R .RE This setting for the \-compatibility option omits all Aegis extensions. .PP By default, a context diff is generated. Some projects prefer to use the unified diff format. This is controlled by the \fIpatch_diff_command\fP field of the project configuration file (see \fIaepconf\fP(5) for more information). If you have GNU diff, use the following command: .RS patch_diff_command = "set +e; " "diff -u --text " "-L ${quote $index} -L ${quote $index} " "${quote $original} ${quote $input} > ${quote $output}; " "test $? -le 1""; .RE This setting will cause the \fIaepatch\fP(1) command to produce unified diff patches instead of context diff patches. As you can see from this command, the \fIaepatch\fP(1) command is onlu of use if you have text source files; it produces less than ideal results for binary files. .SS Options The following options are understood by the send variant: .so o_change.so .so o_compatibil.so .so o_compress.so .so o_cte.so .so o_delta.so .so o_output.so .so o_project.so .so o_sob.so .SH RECEIVE The receive variant takes a patch and creates an Aegis change (see \fIaenc\fP(1)) to implement the change within. Files are added to the change (see \fIaenf\fP(1), \fIaecp\fP(1), \fIaerm\fP(1), \fIaent\fP(1)) and then the patch contents are unpackaged into the development directory, and the changes applied to the files. .PP The patch does not have to be produced by the \fI\*(n)\fP(1) command. Normal patches produced by \fIdiff\fP(1) command are also valid input. The intent is that you can particicate in normal open source development, and also use Aegis, even if your fellow developers are not. .PP Once unpacked, the change is then built (see \fIaeb\fP(1)), differenced (see \fIaed\fP(1)), and tested (see \fIaet\fP(1)). The automatic process stops at this point, so that you can confirm that the change is desired. .SS File Names It is common for patch files generated using the usual \fIdiff -r\fP mechanism to contain extra path prefixes. The \fI\*(n)\fP(1) command attempts to remove these automagically. This is usually possible because patches usually modify files within the project, so the patch file names are compared with project file names to guess which and how much path prefixes to remove. .TP 8n \fB\-Remove_Path_Prefix\fP \fIstring\fP This option may be used to explicitly specify path prefixes to be removed, if present. It may be specified more than once. .PP If you have a complex project directory structure, from time to time people may send you patches relative to a sub-directory, rather than relative to the project root. The \fI\*(n)\fP(1) program can't guess this by itself. .TP 8n \fB\-Add_Path_Prefix\fP \fIstring\fP This option may be used to specify the path of a project sub-directory in which to apply the patch. .SS Notification The \fI\*(n)\fP command invokes various other Aegis commands. The usual notifications that these commands would issue are issued. .SS Options The following options are understood by the receive variant: .TP 8n \fB\-Change\fP \fInumber\fP This option may be used to choose the change number to be used, otherwise the change number in the patch (if present) will be used if it is available, otherwise one will be chosen automatically. .TP 8n \fB\-DELta\fP \fInumber\fP .br This option may be used to specify a particular delta in the project's history to copy the file from, just as for the \fIaecp\fP(1) command. You may also use a delta name instead of a delta number. .so o_dir.so .so o_file_cs.so .TP 8n \fB\-Project\fP \fIname\fP This option may be used to set the project name. If not specified the project name in the input package will be used (if present), otherwise the usual project name default will be used. .so o_trojan.so .SS Security Receiving changes by e-mail, and automatically committing them to the baseline without checking them, would be a recipe for disaster. A number of safeguards are provided: .TP 2n \(bu The format of the package is confirmed to be correct, and the package verified for internal consistency, before it is unpacked and acted upon. .TP 2n \(bu The automatic portion of the process stops before development ends. This ensures that the receiver validates the change before it is committed, and then it must also be reviewed, preventing accidental or malicious damage. .TP 2n \(bu The more you use Aegis' test management facilities (see \&\fIaent\fP(1) and \&\fIaet\fP(1)) the harder it is for an inadequate change to get into the baseline. .SH LIST The list variant can be used to list the contents of a package without actually unpacking it first. The output is reminiscent of the \fIaegis -list change-details\fP output. .SS Options The following options are understood by the list variant: .so o_file_cs.so .so o_output.so Only useful with the \-List option. .SH OPTIONS The following options to this command haven't been mentioned yet: .so o_help.so .so o__rules.so .SH FILE FORMAT The file format re-uses existing formats, rather than introduce anything new. This means it is possible to extract the contents of a package even when \*(n) is unavailable. .TP 2n \(bu On sending, the source files are generated using the \fIdiff\fP(1) program, in the same way a normal Unix patch is generated. .br On receiving, the differences are applied to the source files, in the same manner as the normal \fIpatch\fP(1) program. .TP 2n \(bu On sending, the patch is compressed using the GNU gzip format. Typically primary source files are ASCII text, resulting in significant compression. (This is optional.) .br On receiving, if the patch is compressed it will be automagically uncompressed, detection is automatic, you do not need to do this yourself. .TP 2n \(bu On sending, the compressed patch is encoded using the MIME base64 encoding. This makes the result approximately 33% larger than the compressed binary would be, but still smaller than the primary sources. (This is optional.) .br On receiving, if the patch is MIME64 encoded it will be automatically decoded, detetcion is automatic, you do not need to do this yourself. .so z_exit.so .so z_cr.so