mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
diff(1): docuemnt merge3
This commit is contained in:
parent
c59eb6d117
commit
4738d90516
2 changed files with 43 additions and 2 deletions
|
@ -7,6 +7,9 @@ diff \- differential file comparator
|
|||
.B -abcefmnruw
|
||||
]
|
||||
.I file1 ... file2
|
||||
.PP
|
||||
.B merge3
|
||||
.I left common right
|
||||
.SH DESCRIPTION
|
||||
.I Diff
|
||||
tells what lines must be changed in two files to bring them
|
||||
|
@ -165,6 +168,44 @@ Except in rare circumstances,
|
|||
.I diff
|
||||
finds a smallest sufficient set of file
|
||||
differences.
|
||||
.PP
|
||||
Merge3 merges the contents of
|
||||
.I left
|
||||
and
|
||||
.I right
|
||||
using
|
||||
.I common
|
||||
as a common reference between the two files.
|
||||
Changes between
|
||||
.IR left ,
|
||||
.I right
|
||||
and
|
||||
.I common
|
||||
are computed.
|
||||
Any change which does not conflict is output directly.
|
||||
When a change does conflict, that is to say,
|
||||
affects the same lines of the output file,
|
||||
then the change is output with conflict markers.
|
||||
The conflict markers look like this:
|
||||
.IP
|
||||
.EX
|
||||
leading content
|
||||
<<<<<<<<<< leftfile
|
||||
this is an edit made
|
||||
to the left file
|
||||
========== original
|
||||
this is the initial content
|
||||
========== rightfile
|
||||
here is something that was
|
||||
written into the right file
|
||||
>>>>>>>>>>
|
||||
trailing content
|
||||
.EE
|
||||
.PP
|
||||
If no conflicts are detected,
|
||||
.I merge3
|
||||
exits with a nil status,
|
||||
otherwise it exits with a status of "conflicted".
|
||||
.SH FILES
|
||||
.B /tmp/diff[12]
|
||||
.SH SOURCE
|
||||
|
|
|
@ -155,11 +155,11 @@ merge(Diff *l, Diff *r)
|
|||
Bprint(&stdout, "========== %s\n", r->file2);
|
||||
fetch(r, r->ixnew, rc->newx, rc->newy, r->input[1], "");
|
||||
Bprint(&stdout, ">>>>>>>>>>\n");
|
||||
status = "conflict";
|
||||
}
|
||||
ln = y+1;
|
||||
il++;
|
||||
ir++;
|
||||
status = "conflict";
|
||||
}else if(rc == nil || (lc != nil && lx < rx)){
|
||||
fetch(l, l->ixold, ln, lc->oldx-1, l->input[0], "");
|
||||
fetch(l, l->ixnew, lc->newx, lc->newy, l->input[1], "");
|
||||
|
|
Loading…
Reference in a new issue