Manual Reference Pages - FMERGE (1)
fmerge - merge files
fmerge program is used to
compare the changes between two different descendants of a
and creates an output file which contains both sets of changes.
This is useful when two users both take the same version of a file and
make independent edits to it,
and then later want to create a file which
contains both sets of edits.
In such a use,
the original file that both sets of edits is derived from is
base file. The two files containing the edits are called
file A and
fmerge basefile fileA fileB -o outputfile
produces the output file which contains the edits contained in
file A and
file B, based on the
base file . If the
option was not used,
or if no outputfile is specified,
then the merged lines are typed to the standard output.
The order of specifying
file A and
file B is usually unimportant.
fmerge program can also be used to remove earlier edits made to a module.
To do this,
make the version containing the edits you want to delete be the
Make the version previous to the edit you want deleted be file A.
make the most recent version of the file which contains the other
edits (including the one you want deleted) be file B.
Then the result of
merging will be the newest version of the module minus
the changes made by the edit you wanted removed.
if three successive versions of
some module have the names
edit12, and you want the changes done by
edit11 to be undone,
but still want the changes done by
edit12, then you use the command:
fmerge edit11 edit10 edit12 -o outputfile
While merging the two sets of edits,
fmerge may discover conflicts.
A conflict occurs when the same line of the base file is changed by both
of the two sets of edits.
The change can be due to new lines being inserted,
lines being deleted,
When conflicts occur,
the output file contains
conflict identification lines,
which are lines containing the string
/[mi]/[mi]/[mi]/. These lines indicate the region where
the two sets of edits are incompatible.
You must then edit the output file and remove these lines,
and in addition
correct the conflicts manually in order to produce the correct result.
The following options are understood:
-Conflicts [ conflictfile ]
Since conflicts due to deletions are invisible in the output file,
and inserts do not specify which of the two edits inserted the lines,
there is an alternative output format from the
This output format describes what happens to each line of the base file,
so that conflicts are easier to detect and fix.
produces the file describing the results of the merge in detail.
option is specified without any conflictfile name,
then the conflicts are send to the standard output.
fmerge basefile fileA fileB -c conflictfile
If there are conflicts,
options is not specified,
fmerge program will exit with a status of 1.
The conflict file contains lines which contain three characters and then
The first three characters describe what is happening to the
base file at that point.
These characters are the following:
This line was inserted by file A.
This line was deleted by file A.
This line was inserted by file B.
This line was deleted by file B.
This line is unchanged.
This is a conflict identification line.
There are unspecified unchanged lines here.
Each set of conflicts is flagged by three identification lines.
The first line indicates the beginning of the conflict,
and specifies the line numbers for
the base file and two divergent files.
The second conflict identification
line separates lines changed by file A from lines changed by file B.
The third conflict identification indicates the end of the conflict.
You can edit this conflict file to remove the conflicts.
This involves deleting the conflict identification lines,
and changing the conflicting lines as necessary to fix the conflict.
While doing this,
remember to leave three blank characters at the front
of any new lines you insert while correcting the conflicts.
When you are done,
there should be no lines which begin with an X in the file.
All other lines can remain.
Then you can use the command:
to create the new output file which has the desired data.
option or outputfile is used,
the output is send to the standard output.
fmerge conflictfile -o outputfile
Besides physical conflicts,
there can be logical conflicts.
These are changes made to different lines in the base
file such that the program is no longer correct.
Such conflicts cannot be detected by a program,
and so these must be checked manually.
In order to make this process easier,
option can be used to reduce the size of the conflict file to only
include regions near changed lines.
This file can then be examined in order
to detect possible logical conflicts.
As an example,
will send to the standard output all
changes made by either sets of edits,
with only three unchanged lines surrounding each edit.
fmerge basefile fileA fileB -c -u 3
When using the
the conflict file will contain lines starting with U.
These represent unchanged lines,
and the number following the letter is the number of unchanged lines.
The resulting conflict file
cannot be read to produce an output file because of the missing lines.
If this is attempted,
an error will be generated.
It is possible to use both
in the same command.
Thus you can produce the output file which you hope is correct,
and also produce the conflict file which you can use to
check for logical conflicts.
-Verbose [ number ]
This option can be specified with any other action,
and outputs status information about the progress of the action.
This is useful for debugging of problems,
or just for amusement when the system is slow or a large file
is being processed.
It accepts a numeric argument to indicate the verbosity for output.
The levels are as follows:
No output at all (except for errors).
Single[hy]line output describing action (default).
Detailed status as action proceeds.
This option restricts the number of physical conflicts that are
allowed before failing.
This is used if you are not interested in the
results if there are too many conflicts.
[Include document lib/en/man1/o_help.so]
Ignore all conflicts.
The option may be used to suppress conflicts which make identical
deletes, or identical inserts, or identical changes.
This is often desirable when merging two source code branches.
[Include document lib/en/man1/o_version.so]
[Include document lib/en/man1/o__rules.so]
[Include document lib/en/man1/z_fne.so]
[Include document lib/en/man1/z_binary.so]
[Include document lib/en/man1/z_exit.so]
[Include document lib/en/man1/z_ref.so]
[Include document lib/en/man1/z_cr.so]
|Reference Manual ||*(N) (1) ||FHist |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.