From d858964067821737c5a8b2f62edc4affd8d80cfe Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Tue, 20 Jun 2023 03:21:02 -0700 Subject: [PATCH] docs: describe how to configure `scm-diff-editor` --- docs/config.md | 18 ++++++++++++++++++ docs/tutorial.md | 9 +++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/config.md b/docs/config.md index 30bd3bb7f..b2dec4c8c 100644 --- a/docs/config.md +++ b/docs/config.md @@ -327,6 +327,24 @@ merge-tools.kdiff3.edit-args = [ "--merge", "--cs", "CreateBakFiles=0", "$left", "$right"] ``` +### Setting up `scm-diff-editor` + +`scm-diff-editor` is a terminal-based diff editor that is part of +the [git-branchless](https://github.com/arxanas/git-branchless) suite of tools. +It's a good alternative to Meld, especially if you don't have a graphical +environment (e.g. when using SSH). To install it: + +```shell +cargo install --git https://github.com/arxanas/git-branchless scm-record +--features scm-diff-editor +``` + +Then config it as follows: + +```toml +ui.diff-editor = ["scm-diff-editor", "--dir-diff", "$left", "$right"] +``` + ### `JJ-INSTRUCTIONS` When editing a diff, jj will include a synthetic file called `JJ-INSTRUCTIONS` diff --git a/docs/tutorial.md b/docs/tutorial.md index 1b7737011..6d7b5ec97 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -331,12 +331,9 @@ try `jj log --at-op=367400773f87` but use the hash from your own `jj op log`. You have already seen how `jj squash` can combine the changes from two commits into one. There are several other commands for changing the contents of existing -commits. These commands assume that you have `meld` installed. If you prefer -`vimdiff`, add this to your `~/.jjconfig.toml` file: -``` -[ui] -diff-editor = "vimdiff" -``` +commits. These commands assume that you have `meld` installed. If you prefer a +terminal-based diff editor, you +can [configure `scm-diff-editor`](config.md#setting-up-scm-diff-editor) instead. We'll need some more complex content to test these commands, so let's create a few more commits: