merge3

Crates.iomerge3
lib.rsmerge3
version0.2.0
sourcesrc
created_at2024-04-14 15:43:58.783167
updated_at2024-08-14 23:49:01.406494
descriptionA simple merge tool for three-way merges
homepage
repositoryhttps://github.com/breezy-team/merge3-rs
max_upload_size
id1208330
size63,956
Jelmer Vernooij (jelmer)

documentation

README

Merge3

A rust implementation of 3-way merge of texts.

Given BASE, OTHER, THIS, tries to produce a combined text incorporating the changes from both BASE->OTHER and BASE->THIS. All three will typically be sequences of lines.

Usage

From the command-line::


$ echo foo > mine
$ echo bar > base
$ echo blah > other
$ merge3 mine base other > merged
$ cat merged

Or from rust:


use merge3::Merge3;

fn main() {
    let base = vec!["common\n", "base\n"];
    let this = vec!["common\n", "a\n"];
    let other = vec!["common\n", "b\n"];

    let m3 = Merge3::new(&base, &this, &other);

    for line in m3.merge_lines() {
        println!("{}", line);
    }
}
Commit count: 0

cargo fmt