|Comparing and Merging Files with GNU diff and patch|
by David MacKenzie, Paul Eggert, and Richard Stallman
Paperback (6"x9"), 120 pages
RRP £12.95 ($19.95)
"Well packaged... the quality of information is excellent" --- Linux User and Developer Magazine (Issue 36, Feb 2004) Get a printed copy>>>
15.1 Options to
Here is a summary of all of the options that GNU
accepts. See section 10.13 GNU
patch and Traditional
patch, for which of these options are
safe to use in older versions of
Multiple single-letter options that do not take an argument can be combined into a single command line argument with only one dash.
- Back up the original contents of each file, even if backups would normally not be made. See section 10.8 Backup Files.
- Prepend prefix to backup file names. See section 10.9 Backup File Names.
- Back up the original contents of each file if the patch does not exactly match the file. This is the default behavior when not conforming to POSIX. See section 10.8 Backup Files.
- Read and write all files in binary mode, except for standard output and ‘/dev/tty’. This option has no effect on POSIX-conforming systems like GNU/Linux. On systems where this option makes a difference, the patch should be generated by ‘diff -a --binary’. See section 1.7 Binary Files and Forcing Text Comparisons.
Interpret the patch file as a context diff. See section 10.1 Selecting the
- Make directory directory the current directory for interpreting both file names in the patch file, and file names given as arguments to other options. See section 10.7 Applying Patches in Other Directories.
- Make merged if-then-else output using name. See section 2.6 Merging Files with If-then-else.
Print the results of applying the patches without actually changing
any files. See section 10.3.4 Predicting what
Interpret the patch file as an
edscript. See section 10.1 Selecting the
- Remove output files that are empty after the patches have been applied. See section 10.4 Creating and Removing Files.
Assume that the user knows exactly what he or she is doing, and do not
ask any questions. See section 10.11 Messages and Questions from
Set the maximum fuzz factor to lines. See section 10.3.3 Helping
patchFind Inexact Matches.
- If num is positive, get input files from a revision control system as necessary; if zero, do not get the files; if negative, ask the user whether to get the files. See section 10.2 Revision Control.
- Output a summary of usage and then exit.
Read the patch from patchfile rather than from standard input.
See section 15.1 Options to
- Let any sequence of blanks (spaces or tabs) in the patch file match any sequence of blanks in the input file. See section 10.3.1 Applying Patches with Changed White Space.
Interpret the patch file as a normal diff. See section 10.1 Selecting the
Ignore patches that
patchthinks are reversed or already applied. See also
-R. See section 10.3.2 Applying Reversed Patches.
- Do not back up the original contents of files. This is the default behavior when conforming to POSIX. See section 10.8 Backup Files.
Use file as the output file name. See section 15.1 Options to
- Set the file name strip count to number. See section 10.7 Applying Patches in Other Directories.
Conform to POSIX, as if the
POSIXLY_CORRECTenvironment variable had been set. See section 10.12
patchand the POSIX Standard.
Use style word to quote names in diagnostics, as if the
QUOTING_STYLEenvironment variable had been set to word. See section 10.11.3
- Use reject-file as the reject file name. See section 10.10 Reject File Names.
- Assume that this patch was created with the old and new files swapped. See section 10.3.2 Applying Reversed Patches.
Work silently unless an error occurs. See section 10.11 Messages and Questions from
Do not ask any questions. See section 10.11 Messages and Questions from
- Set the modification and access times of patched files from time stamps given in context diff headers, assuming that the context diff headers use local time. See section 10.5 Updating Time Stamps on Patched Files.
Interpret the patch file as a unified diff. See section 10.1 Selecting the
- Output version information and then exit.
- Select the naming convention for backup file names. See section 10.9 Backup File Names.
Print more diagnostics than usual. See section 10.11 Messages and Questions from
Set internal debugging flags. Of interest only to
- Prepend prefix to base names of backup files. See section 10.9 Backup File Names.
- Use suffix as the backup extension instead of ‘.orig’ or ‘~’. See section 10.9 Backup File Names.
- Set the modification and access times of patched files from time stamps given in context diff headers, assuming that the context diff headers use UTC. See section 10.5 Updating Time Stamps on Patched Files.
|ISBN 0954161750||Comparing and Merging Files with GNU diff and patch||See the print edition|