style: show only jj change IDs in revision labels

This commit is contained in:
Valdemar Lorenzen
2026-10-12 15:23:30 +02:00
parent 9f1ea04f4d
commit d64704d4eb
3 changed files with 3 additions and 39 deletions
+2
View File
@@ -307,6 +307,8 @@ The changed-file explorer is **docked on the right**. Modified files show Before
Diff metadata lives in the text-pane borders instead of a separate info row: split panes show their own Before/After revision labels at the bottom-left; a single visible pane shows the combined `before → after` label there. Each pane shows its read-only/editable state at the top-right, independently of keyboard focus. Before is always read-only; After is editable only for an eligible Working-checkout file. The changed-file explorer and panes start directly below configured chrome, and there is no native-buffer help footer. Loading/error/file notices remain visible when applicable. Narrow borders prioritize state and clip titles without painting over the gutter or source text.
For jj-managed repositories, revision entries and border labels display only the change ID; Git repositories keep commit-ID labels, and named bookmarks retain their names. The backing commit ID remains the exact comparison target and can still be used to filter revisions.
Text panes use normal buffer interaction regardless of writability: motions and counts, search, Visual/Visual Line selections, multiple carets, yank, remapped bindings, and non-mutating actions work in Before and After. Read-only snapshots reject insert/delete/change/paste, repeat edits, undo/redo, mutating plugin effects, and saves, including saves to another path. Their text retains the revision's final newline. Snapshots use separate virtual LSP document identities and do not appear in ordinary buffer lists or dirty-buffer comparisons. Closing the diff disposes unreferenced snapshots and restores the live or original buffer in its workspace pane; snapshots displayed by other panes or tabs remain read-only until closed. Explicit buffer commands and Markdown/plugin navigation retain their ordinary behavior; native LSP definitions use the routing below.
**LSP definition, hover, and diagnostics work normally in focused Before and After text panes**, including historical snapshots. Each snapshot is served with its immutable revision text and its own document URI, not the current disk contents. Completion and completion edits are available only in writable Working-checkout After; they use the shared buffer's normal undo history. Revision selectors and the changed-file explorer are not document-action targets.
+1 -1
View File
@@ -407,7 +407,7 @@ impl Repository {
let target = RevisionTarget::Commit(id.clone());
entries.push(Revision {
target: target.clone(),
label: format!("{change} {id}"),
label: change.clone(),
description: description.trim_end_matches('\n').into(),
category: Category::Revisions,
});
-38
View File
@@ -534,19 +534,6 @@ fn jj_catalog_and_working_comparisons_prefer_jj_and_never_snapshot_or_merge_oper
"commit_id",
],
);
let change = jj(
&active,
&[
"--ignore-working-copy",
"--at-operation=@",
"log",
"--no-graph",
"-r",
"@",
"-T",
"change_id",
],
);
jj(&active, &["bookmark", "create", "baseline"]);
jj(&active, &["new"]);
fs::write(active.join("file"), "disk\n").unwrap();
@@ -564,8 +551,6 @@ fn jj_catalog_and_working_comparisons_prefer_jj_and_never_snapshot_or_merge_oper
r.target == RevisionTarget::Commit(id.clone()) && r.category == Category::Revisions
})
.unwrap();
assert!(baseline.label.contains(&id) && baseline.label.contains(&change));
assert_eq!(baseline.description, "jj baseline searchable");
assert!(
catalog
.entries
@@ -641,27 +626,6 @@ fn jj_private_fetch_discovers_never_fetched_bookmark_and_searchable_remote_chang
bare.to_str().unwrap(),
],
);
// Git transport may derive imported change IDs; compare with an independent
// CLI import rather than assuming the exporting store's private metadata.
let oracle = fixture.dir("oracle");
init_jj(&oracle, false);
jj(
&oracle,
&["git", "remote", "add", "origin", bare.to_str().unwrap()],
);
jj(&oracle, &["git", "fetch", "--remote", "origin"]);
let change = jj(
&oracle,
&[
"--ignore-working-copy",
"log",
"--no-graph",
"-r",
&ancestor,
"-T",
"change_id",
],
);
let active = fixture.dir("active");
init_jj(&active, false);
fs::write(active.join("file"), "local\n").unwrap();
@@ -709,8 +673,6 @@ fn jj_private_fetch_discovers_never_fetched_bookmark_and_searchable_remote_chang
&& r.category == Category::Revisions
})
.unwrap();
assert!(historic.label.contains(&ancestor) && historic.label.contains(&change));
assert_eq!(historic.description, "remote historic needle");
let comparison = compare_loaded(&mut repository, historic, &remote, &[]).unwrap();
assert_eq!(
changed(&comparison, Path::new("file")).before,