From 2da0bb429eb5667acc8be70f81196dbc8d47187f Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 23 Nov 2026 11:37:50 -0300 Subject: changes layer: a Look on a jj change's id opens its patch, its header and whole message at the top, and a Look on a ghost row looks at its word as anywhere (the user's rulings of 2026-11-23: all text is text; a patch of one change opens with its metadata): a word of k to z letters had no meaning to a Look (searched), `Diff` took only a git hash, and a B3 on a ghost row was a button of its own (`lookGhost` opened the line in the revision it came from); now `Diff [path[:line]]` (core/jj.zig `diffChange`, from hunks.zig's word) runs `jj show --git -r change_id()` in the pane's repository (on the tape, as `At`'s `jj file show`), stacks it in the change's own `+Diff-` with jj's header above the hunks (Commit ID, Change ID, Author, Committer, the whole message) and puts the cursor on `path`'s row for `line` (that file's first row without one, the top without a place; a second Look moves the open one); a plumbing rule sends a change id looked at in any pane (eight to thirty-two letters k to z, as `jj log` writes them: four would name a change by accident too often) to `Diff`, which declines a word that names no change, so it is searched as before; a B3 on a ghost row looks at the word under it (`wordAt`, then the regular `look.lookAt`), and on a description's id runs `Diff :` with the line of that change's last hunk in this file, the text a user could type; tests: "a Look on a change's id opens its patch ..." (B3 on mid's description id in a terminal and a window: a `+Diff-` pane, its first lines jj's header, ` mid` in it, the cursor on a.zig:4; the same typed with a.zig:2; `Look ` from the file: cut's patch at its top; `Look zzzzzzzz`: no patch), the ghost-row test's Look now asserts a B3 on `c();`'s ghost row is what `Look c` does (no revision opens), and hunks.zig's "a log of several changes keeps each one's header and whole message above its own hunks" (git log -p: each commit's header above its own hunks: it passed on the base: the format keeps them); core-test 927/1091 (164 skipped), shell-test 1133/1136 (3 skipped) Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- core/plumbing | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'core/plumbing') diff --git a/core/plumbing b/core/plumbing index 4e8cd702..7292577f 100644 --- a/core/plumbing +++ b/core/plumbing @@ -43,6 +43,15 @@ data matches '[0-9a-f]*[0-9][0-9a-f]*' data matches '[0-9a-f]*[a-f][0-9a-f]*' plumb start Diff $0 +# a jj change id looked at in the editor (eight or more of its letters, +# k to z, as jj log shows them), in a jj repository: jj show, its header +# and its hunks, stacked in a +Diff (a word that names no change: Diff +# declines and the word is searched for) +type is text +src is pardes +data matches '[k-z]{8,32}' +plumb start Diff $0 + # a diff paged (git show, git log -p) is shown stacked in a +Diff in # its +Pager's place type is text/x-diff -- cgit v1.3