Skip to content

Commit

Permalink
Add another way to resolve merge conflicts with Meld
Browse files Browse the repository at this point in the history
  • Loading branch information
amiryal committed Feb 20, 2024
1 parent 966a550 commit 9695738
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* Added completions for [Nushell](https://nushell.sh) to `jj util completion`

* Another way to resolve conflicts with Meld, in 3 tabs, adding to the
experimental `meld-3` tool.

### Fixed bugs

* On Windows, symlinks in the repo are now materialized as regular files in the
Expand Down
9 changes: 9 additions & 0 deletions cli/src/config/merge_tools.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ merge-args = ["$left", "$base", "$right", "-o", "$output", "--auto-merge"]
program="meld"
# If using this as a template, note that `$output` is repeated twice below
edit-args = ["$left", "$output", "$right", "-o", "$output"]
# With Meld's 3-way merge resolution mode, once the output pane has been
# edited, it loses the original contents of `$base`. Here we offer an
# alternative that opens the original two sides compared to the base in two
# more tabs.
merge-args = ["--diff", "$left", "$output", "$right", "--diff", "$base", "$left", "--diff", "$base", "$right"]
# To make it useful, the output pane must be prepopulated with _something_. The
# conflict markers here are not a great distraction, and might even be helpful
# in their own right.
merge-tool-edits-conflict-markers = true

[merge-tools.vimdiff]
program = "vim"
Expand Down
9 changes: 9 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,15 @@ the conflict is done, `jj` assumes that the conflict was only partially resolved
and parses the conflict markers to get the new state of the conflict. The
conflict is considered fully resolved when there are no conflict markers left.

### Experimental 3-tab conflict resolution

The `"meld-3"` merge editor does not use the `--auto-merge` feature. Instead,
it sets up Meld to show 3 tabs. The first tab opens a 3-pane view of the left
and right sides with an editing pane in the middle. The middle pane contains
the output with conflict markers to resolve. The next two tabs open 2-pane
views for reference while editing, each showing a diff from the base to one of
the sides.

## Commit Signing

`jj` can be configured to sign and verify the commits it creates using either
Expand Down

0 comments on commit 9695738

Please sign in to comment.