Up: unify   [Contents]


4.1 Invoking unify

The format for running the unify program is:

unify option … [file]

The program reads the diff to convert from file, or if the source file is not mentioned, it will be read from the standard input. The default is to output the diff in the opposite style of whatever was input, that is, regular context diffs will become unified context diffs, and unified context diffs will become unified context diffs, but this can be overridden by options.

unify supports the following command line options:

--version

Merely prints the version numbers on standard output, and exits without doing anything else.

--help

Merely prints a page of help on standard output, and exits without doing anything else.

--context-diffs
-c

Forces context diff output.

--echo-comments
-e

Echoes non-diff (comment) lines to stderr. If a comment line is being stripped via the -p option, it is echoed with a preceding ‘!!! ’. If all comments are being stripped (via the -s option), no special designation is given.

--old-diffs
-o

Is used to force a context diff to be interpreted as being of the old-style even if it has the extra trailing asterisks that normally mark the new-style. This is only needed if unify fails to work with your version of diff.

--patch-format
-p

Turns on patch-output mode. This will do two things:

  1. Transform a header like:
    *** orig/file	Sat May  5 02:59:37 1990
    --- ./file	Sat May  5 03:00:08 1990
    

    into a line of ‘Index: file’ — we choose the shorter name and strip a leading ‘./’ sequence if present.

  2. Strip lines that begin with ‘Only in ’, ‘Common subdir’, ‘Binary files’ or ‘diff -’.
-P

Is the same as -p.

--strip-comments
-s

Strips non-diff lines (comments).

--unidiffs
-u

Forces unified diff output.

-U

Is the same as -up.

--use-equals
-=

Will use a ‘=’ prefix in a unified diff for lines that are common to both files instead of using a leading space. Though this is harder to read, it is less likely to be mangled by trailing-space-stripping sites when posted to Usenet.


Up: unify   [Contents]