GNU Info

Info Node: (diff.info)Merging with patch

(diff.info)Merging with patch


Next: Making Patches Prev: Interactive Merging Up: Top
Enter node , (file) or (file)node

Merging with `patch'
********************

   `patch' takes comparison output produced by `diff' and applies the
differences to a copy of the original file, producing a patched
version.  With `patch', you can distribute just the changes to a set of
files instead of distributing the entire file set; your correspondents
can apply `patch' to update their copy of the files with your changes.
`patch' automatically determines the diff format, skips any leading or
trailing headers, and uses the headers to determine which file to
patch.  This lets your correspondents feed an article or message
containing a difference listing directly to `patch'.

   `patch' detects and warns about common problems like forward
patches.  It saves the original version of the files it patches, and
saves any patches that it could not apply.  It can also maintain a
`patchlevel.h' file to ensures that your correspondents apply diffs in
the proper order.

   `patch' accepts a series of diffs in its standard input, usually
separated by headers that specify which file to patch.  It applies
`diff' hunks (Note: Hunks) one by one.  If a hunk does not exactly
match the original file, `patch' uses heuristics to try to patch the
file as well as it can.  If no approximate match can be found, `patch'
rejects the hunk and skips to the next hunk.  `patch' normally replaces
each file F with its new version, saving the original file in `F.orig',
and putting reject hunks (if any) into `F.rej'.

   Note: Invoking patch, for detailed information on the options to
`patch'.  Note: Backups, for more information on how `patch' names
backup files.  Note: Rejects, for more information on where `patch'
puts reject hunks.

patch Input
Selecting the type of `patch' input.
Imperfect
Dealing with imperfect patches.
Empty Files
Removing empty files after patching.
Multiple Patches
Handling multiple patches in a file specially.
patch Messages
Messages and questions `patch' can produce.

automatically generated by info2www version 1.2.2.9