Skip to content

Commit

Permalink
Expand the meld-3 tool experiment to editing file conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
amiryal committed Feb 22, 2024
1 parent 966a550 commit 17e3701
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
8 changes: 8 additions & 0 deletions cli/src/config/merge_tools.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ 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 the normal Meld merge conflict resolution setup, changes from `$base` to
# either side are not highlighted. 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"]
# The output pane in the first tab must be prepopulated with _something_. The
# conflict markers were chosen here, rather than simply the base, because they
# contain enough information to let you skip the other tabs for simple cases.
merge-tool-edits-conflict-markers = true

[merge-tools.vimdiff]
program = "vim"
Expand Down
10 changes: 10 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,16 @@ 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 opens 3 tabs in Meld. The first tab is 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. This first tab
contains enough information on its own to resolve the conflicts. The next two
tabs are 2-pane views for reference, each showing a diff from the base to one
of the sides. The last tab (the right side compared to base) is generally the
more useful of the two reference tabs.

## Commit Signing

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

0 comments on commit 17e3701

Please sign in to comment.