Forum: Ruby Merge / Diff algo

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
53a1f0aba6f0489d49f5e6fc3df323fa?d=identicon&s=25 Robert James (robertjames)
on 2007-03-15 23:10
(Received via mailing list)
Is there any lib to do simple text based merges (3 way) from Ruby?

Perhaps it's simple enough to do without an external lib.  Just need
to see which lines child1 added to parent, which ones child1 deleted,
and same for child2, and then merge them - in order...

Hmmm... perhaps I should use an external lib...
D812408537ac3a0fa2fec96eb8811559?d=identicon&s=25 John Carter (johncarter)
on 2007-03-15 23:56
(Received via mailing list)
On Fri, 16 Mar 2007, S. Robert James wrote:

> Is there any lib to do simple text based merges (3 way) from Ruby?
>
> Perhaps it's simple enough to do without an external lib.  Just need
> to see which lines child1 added to parent, which ones child1 deleted,
> and same for child2, and then merge them - in order...
>
> Hmmm... perhaps I should use an external lib...


`diff3 -Em myfile oldfile yourfile`


John Carter                             Phone : (64)(3) 358 6639
Tait Electronics                        Fax   : (64)(3) 359 4632
PO Box 1645 Christchurch                Email : john.carter@tait.co.nz
New Zealand
31ab75f7ddda241830659630746cdd3a?d=identicon&s=25 Austin Ziegler (austin)
on 2007-03-16 01:59
(Received via mailing list)
On 3/15/07, S. Robert James <srobertjames@gmail.com> wrote:
> Is there any lib to do simple text based merges (3 way) from Ruby?
>
> Perhaps it's simple enough to do without an external lib.  Just need
> to see which lines child1 added to parent, which ones child1 deleted,
> and same for child2, and then merge them - in order...
>
> Hmmm... perhaps I should use an external lib...

I seem to recall that someone had put some merge operations around
Diff::LCS.

-austin
This topic is locked and can not be replied to.