Skip to content

wallentx/dplex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dplex

1000035721

dplex is an interactive terminal merge conflict reviewer.

It lets you review hunks ( ͡° ͜ʖ ͡°)

Pass it a file that contains Git conflict markers:

dplex path/to/conflicted-file

Or compare two files directly:

dplex configA.yaml configB.yaml

Two-file mode reviews changed regions as conflicts and writes to the first file by default.

For each conflict, dplex shows ours and theirs inline. Press o to choose ours, t to choose theirs, Ctrl+s to save, S to save as, or q, Esc, or Ctrl+C to stop. Chosen hunks update the document view in place; unsaved chosen text is highlighted yellow. Unreviewed conflicts are left untouched in conflict-file mode and keep ours in two-file mode.

Useful Git mergetool starting point:

[merge]
    tool = dplex

[merge.tool "dplex"]
    cmd = dplex "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
    trustExitCode = true

[mergetool]
    keepBackup = false

dplex also supports direct single-file use, so dplex "$MERGED" works too.

Fixtures

The fixtures/ directory contains conflicted files you can copy and run against while tuning the UI:

mkdir -p target/fixtures
cp fixtures/single/simple.txt target/fixtures/simple.txt
cargo run -- target/fixtures/simple.txt

For the Git mergetool argument shape:

mkdir -p target/fixtures
cp fixtures/mergetool/merged.txt target/fixtures/merged.txt
cargo run -- fixtures/mergetool/base.txt fixtures/mergetool/local.txt fixtures/mergetool/remote.txt target/fixtures/merged.txt

For two-file diff mode:

mkdir -p target/fixtures
cp fixtures/pair/configA.yaml target/fixtures/configA.yaml
cargo run -- target/fixtures/configA.yaml fixtures/pair/configB.yaml

About

Diff Multiplexer - A TUI mergetool

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages