From 8fa72a4347c9ef113ee48e4ae0d3530834ff161e Mon Sep 17 00:00:00 2001 From: David Yonge-Mallo Date: Tue, 19 May 2026 12:40:14 +0200 Subject: [PATCH] docs: highlight notable feature additions and breaking changes --- README.md | 29 +++++++-- doc/diffview_changelog.txt | 118 ++++++++++++++++++++++++++++++++++++- 2 files changed, 141 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index df298c99..045ff2dc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Diffview.nvim -> **Note:** This is an **actively maintained fork** of [sindrets/diffview.nvim](https://github.com/sindrets/diffview.nvim) with bug fixes and improvements applied. The original repository has not been updated since June 2024. +> **Note:** This is an **actively maintained fork** of [sindrets/diffview.nvim](https://github.com/sindrets/diffview.nvim) with bug fixes and improvements applied. The original repository has not been updated since June 2024. See [`doc/diffview_changelog.txt`](doc/diffview_changelog.txt) (`:h diffview.changelog`) for breaking changes and notable additions. ## Introduction @@ -83,6 +83,19 @@ and committing workflows. right side). Once you write to an index buffer the index will be updated. (Note: Staging is a Git concept. These actions are no-ops on Jujutsu.) +- **Unified Inline Diff** — `diff1_inline` layout renders adds/deletes + in a single window via extmark overlays, with tree-sitter highlights + preserved on both added and deleted lines. Configurable via + `view.inline.style` (`"unified"` / `"overleaf"`). + +- **Multi-file Selection** — Select multiple files in the file panel + (`w` to toggle, `C` to clear) for batch stage / unstage / restore. + Selections persist across Neovim restarts. + +- **Pin Local in File History** — Run `:DiffviewFileHistory --pin-local` + to keep the working tree on one side while cycling commits on the + other (Git only). + ## Commands | Command | Description | @@ -90,6 +103,8 @@ and committing workflows. | `:DiffviewOpen [rev] [options] [ -- {paths...}]` | Open a diff view | | `:DiffviewFileHistory [paths] [options]` | Browse file/commit history | | `:DiffviewDiffFiles {file1} {file2}` | Diff two arbitrary files | +| `:DiffviewMergeFiles {output} [{base}] {left} {right}` | 3-way / 4-way merge editor (no VCS required) | +| `:DiffviewDiffDirs {left} {right} [{output}]` | Compare two on-disk directories (no VCS required) | | `:DiffviewClose` | Close the current diffview. You can also use `:tabclose`. | | `:DiffviewToggleFiles` | Toggle the file panel | | `:DiffviewFocusFiles` | Bring focus to the file panel | @@ -108,10 +123,14 @@ Examples: #### VCS Adapter Notes -- **Jujutsu** supports `:DiffviewOpen` and `:DiffviewFileHistory`, but not - `--pin-local` or line-range history (`:'<,'>DiffviewFileHistory`). The - options `--cached`, `--staged`, and `--imply-local` are Git-only. In - colocated repos, set `preferred_adapter = "jj"` to use the Jujutsu adapter. +- **Jujutsu** supports `:DiffviewOpen`, `:DiffviewFileHistory`, and works as + jj's external merge tool (`:DiffviewMergeFiles`) and diff editor + (`:DiffviewDiffDirs`); see `:h :DiffviewMergeFiles` and + `:h :DiffviewDiffDirs` for `~/.config/jj/config.toml` wiring. The options + `--cached`, `--staged`, `--imply-local`, the `--pin-local` flag, and + line-range history (`:'<,'>DiffviewFileHistory`) are not supported; + staging actions are no-ops (jj has no staging index). In colocated + repos, set `preferred_adapter = "jj"` to use the Jujutsu adapter. - **Sapling** is detected automatically through the Mercurial adapter. Use `hg_cmd` to configure the executable (e.g. `hg_cmd = { "sl" }`). - **Perforce** support is experimental. Requires the `p4` CLI ≥ 2019.1 diff --git a/doc/diffview_changelog.txt b/doc/diffview_changelog.txt index 660b618b..3483d497 100644 --- a/doc/diffview_changelog.txt +++ b/doc/diffview_changelog.txt @@ -3,7 +3,123 @@ CHANGELOG -NOTE: This changelog only encompasses breaking changes. +NOTE: Breaking changes and notable feature additions are listed here. + + *diffview.changelog-jj-adapter* + +ISSUE: https://github.com/sindrets/diffview.nvim/issues/562 + +The Jujutsu (jj) adapter supports `:DiffviewOpen` and +`:DiffviewFileHistory` end-to-end, and implements `file_restore` via +`jj restore --from -- ` (with `jj op undo` as the +suggested undo). + +Configure log options under `file_history_panel.log_options.jj` the +same way as `git`/`hg`. Supported flags: `--revisions `, +`--limit `, `--reversed`. + +Staging-related actions (`s`/`S`/`U`, restoring from "staged") are +no-ops in jj — there is no staging index. The adapter surfaces a +one-time warning when these are invoked instead of failing silently. + +The `--pin-local` flag, the line-range `[range]:DiffviewFileHistory` +form, and the `--cached`/`--staged`/`--imply-local` options remain +Git-only. + +In colocated repos, set `preferred_adapter = "jj"` to use the Jujutsu +adapter instead of Git. + + *diffview.changelog-out-of-vcs-views* + +ISSUES: https://github.com/sindrets/diffview.nvim/issues/562, + https://github.com/sindrets/diffview.nvim/issues/286 + +Two new commands open diff views that don't query any VCS, suitable as +external editor entry points for tools like jj's merge tool and diff +editor (and for ad-hoc use). They are also the integration point that +closes issue 286 in the sindrets repo (arbitrary directory +diffing). + +`:DiffviewMergeFiles {output} [{base}] {left} {right}` opens a 3-way or +4-way merge editor backed by on-disk file paths. `{output}` is the +editable buffer; the other paths are read-only. See `:h :DiffviewMergeFiles` +for the `~/.config/jj/config.toml` wiring. + +`:DiffviewDiffDirs {left} {right} [{output}]` opens a side-by-side diff +of two on-disk directories (no VCS involvement); when `{output}` is +provided the middle buffer points at `{output}/` and edits flow +back there. See `:h :DiffviewDiffDirs` for jj's `diff-editor` wiring. + + *diffview.changelog-new-adapters* + +Two additional VCS adapters are supported beyond `git` and `hg`: + + - **Sapling**, detected automatically through the Mercurial adapter. + Use `hg_cmd` to configure the executable (e.g. `hg_cmd = { "sl" }`). + + - **Perforce** (experimental), via the `p4` CLI. Requires `p4` >= + 2019.1 and the environment variables `P4PORT`, `P4USER`, `P4CLIENT`. + Configure log options under `file_history_panel.log_options.p4`. + +See also |diffview.changelog-jj-adapter| for the Jujutsu adapter. + + *diffview.changelog-breaking-panel-show* + +PR: https://github.com/dlyongemallo/diffview.nvim/pull/165 + +`file_panel.show` previously controlled both `:DiffviewOpen` and +`:DiffviewFileHistory`. Visibility is now split: set `file_panel.show` +for diff views and the new `file_history_panel.show` (default `true`) +for file-history views. + + *diffview.changelog-pin-local* + +PR: https://github.com/dlyongemallo/diffview.nvim/pull/158 + +The new `:DiffviewFileHistory --pin-local` flag pins the right-hand +side of the diff to the working-tree copy of the followed path while +the left-hand side cycles through commits. Useful for reviewing how a +file has evolved against its current state. + +Configurable via `view.file_history.pin_local`. Multi-file pinning is +supported through a synthetic `LOCAL` log entry at the top of history. +Git only. Cannot be combined with `--base`. + + *diffview.changelog-diff1-inline* + +PR: https://github.com/dlyongemallo/diffview.nvim/pull/120 + +The new `diff1_inline` layout renders unified diffs in a single window +via extmark overlays. Tree-sitter highlights are preserved on both +added text and deleted virt_lines. + +Style is configurable via `view.inline.style`: + + - `"unified"` (default): standard unified diff appearance. + - `"overleaf"`: inline strikethrough for deletions. + +Deletion highlight is configurable via `view.inline.deletion_highlight`. + + *diffview.changelog-multi-selection* + +PRs: https://github.com/dlyongemallo/diffview.nvim/pull/36, + https://github.com/dlyongemallo/diffview.nvim/pull/45, + https://github.com/dlyongemallo/diffview.nvim/pull/46 + +The file panel supports multi-file selection for batch operations. +Default keymaps: `w` to toggle a selection on the current file, `C` +to clear all selections. Staging, unstaging, restore, and similar +actions operate on the selection when present. + +Selections persist across Neovim restarts. Selection marks and their +placement are configurable via `file_panel.mark_placement` and +`file_panel.always_show_marks`. + + *diffview.changelog-breaking-nvim-010* + +PR: https://github.com/dlyongemallo/diffview.nvim/pull/11 + +The minimum required Neovim version has been bumped to 0.10. *diffview.changelog-271*