Thursday, 15 March 2012

diff - Three-way merge of files (outside version control) -



diff - Three-way merge of files (outside version control) -

i have 3 versions of file: original, changes, , else's changes. three-way merge produce version incorporating both sets of changes (or fail if not possible). note not asking revision command scheme such svn or git. write minimal command-line tool takes 3 files input , writes merge standard output.

one way follows, using unix diff , patch tools. assuming 3 files called orig, my, other:

% diff -u orig | patch -o - other

or doing other way round,

% diff -u orig other | patch -o - my

but fact there 2 ways round diff , merge of code smell. certainly merge tool takes 3 files input improve job.

obviously could initialize empty svn repository, check in orig, check in , other in separate branches, , merge. or equivalent operation in version command system. seems heavyweight , clunky, creating repository thrown away immediately.

is there reasonable three-way merge tool runs standalone command line?

as twalberg said in comment, merge tool looking for.

merge diff patch three-way-merge

No comments:

Post a Comment