Skip to content

Commit

Permalink
diff editor: bundle a new :builtin-web GUI diff editor
Browse files Browse the repository at this point in the history
When called with `--tool :builtin-web`, `jj` will start a local web server and
open a web browser with a GUI to edit the diff. See
https://github.com/ilyagr/diffedit3 for more details (or to run it as a
standalone executable). This is the diff editor previously advertised in
#3094, based on CodeMirror5, with
some improvements since.

I would like to bundle it with `jj` so that everybody has access to a GUI diff
editor that can be run locally or over SSH (with port forwarding). It is
intended for situations where it is a fuss (or impossible) for a user to install
Meld and use the `meld-3` configuration.

Some TODOs and thoughts:

- This diff editor is somewhat restricted; it will ignore symlinks and currently
has no support for executable bits for example. There are some known bugs, see
e.g. the end of [the `diffedit3
README](https://github.com/ilyagr/diffedit3/?tab=readme-ov-file#shorter-term-todos-and-known-bugs).
I'm hoping it's already usable.

- Bundling the diff editor seems to add ~1.5MB to the `jj` binary. This is more
than I expected. Unless there's a way to optimize this, I'm thinking of making
the diff editor an optional feature, but I'd like it enabled by default, at
least in release binaries. Or we could not worry about it.

- I'm considering folding the `diffedit3` repo (or the majority of it) into the
jj source repo, so that it benefits from Dependabot, established code review
procedures, and the reviewers we have for `jj`. The downside is that `jj` will
then contain some Typescript code. However, there will be no need to install
`node` or `npm` *unless* you are specifically working on the webapp; the
"compiled" webapp is included in the repo.

- Currently, `:builtin-web` works just like an external diff editor, creating a
temporary directory on disk and then modifying it. At some point, we might want
to switch to keeping the tree in-memory.
  • Loading branch information
ilyagr committed May 6, 2024
1 parent c5749e3 commit 4121a41
Show file tree
Hide file tree
Showing 9 changed files with 558 additions and 35 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### New features

* New web-based `:builtin-web` diff editor. Try it with `jj split --tool
:builtin-web`.

* The `:builtin` diff editor now has an alias `:builtin-tui`.

* `jj tag list` now prints commit summary along with the tag name.

* Conflict markers now include an explanation of what each part of the conflict
Expand Down
Loading

0 comments on commit 4121a41

Please sign in to comment.