C3: chunk staging, unstaging and revert from the gutter and the diff viewer

- crates/vcs chunk.rs: chunks of a file (buffer text vs index, HEAD vs
  index), a minimal patch applied with git apply --cached, revert as a
  byte edit; token refusal when buffer, index or HEAD changed; CRLF
  (autocrlf and stored), no final newline, BOM, staged renames, first
  commit; binary and untracked refused. Real-git tests + property test.
- engine: git.chunks, git.stageChunk, git.unstageChunk, git.revertChunk
  (revert edits the buffer under the lock, undoable in the editor);
  cmd::git::start_then; git.lineChanges shares the vcs line diff.
- UI: chunk popup on a gutter marker click (Stage / Unstage / Revert /
  Previous / Next), hollow staged markers, vcs.showChunk, diff viewer
  hint, "partly staged" badge in the Changes window.
- Docs: G8 row, Git parity row evidence, ui-parity, architecture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-11-01 12:50:11 +01:00
parent d8e66a4652
commit 301443db7d
28 changed files with 3159 additions and 101 deletions

View file

@ -35,6 +35,7 @@
"command.vcs.push": "Push",
"command.vcs.refresh": "Refresh Changes",
"command.vcs.resolveConflicts": "Resolve Conflicts…",
"command.vcs.showChunk": "Show Changed Chunk at Caret",
"command.vcs.showCommit": "Show Commit in Log",
"command.vcs.showDiff": "Show Diff",
"command.vcs.showHistory": "Show History",
@ -87,10 +88,24 @@
"editor.blame.clickHint": "Click to show this commit in the Log",
"editor.blame.notCommitted": "Not committed yet",
"editor.blame.notCommittedHint": "This line has changes that are not committed.",
"editor.chunk.close": "Close",
"editor.chunk.failed": "That did not work: {reason}",
"editor.chunk.loading": "Reading the change…",
"editor.chunk.next": "Next",
"editor.chunk.none": "No change on this line any more.",
"editor.chunk.previous": "Previous",
"editor.chunk.revert": "Revert",
"editor.chunk.stage": "Stage",
"editor.chunk.staged": "Staged",
"editor.chunk.title": "Changed chunk",
"editor.chunk.truncated": "More lines are not shown.",
"editor.chunk.unstage": "Unstage",
"editor.chunk.unstaged": "Not staged",
"editor.closePrompt.question": "Save changes to {name} before closing?",
"editor.gitGutter.added": "Added since the staged version",
"editor.gitGutter.deleted": "Lines deleted here since the staged version",
"editor.gitGutter.modified": "Changed since the staged version",
"editor.gitGutter.staged": "Staged change (click for the chunk)",
"editor.notice.changedOnDisk": "{name} changed on disk. Your unsaved changes are kept; saving overwrites the file.",
"editor.notice.removedOnDisk": "{name} was deleted on disk. Your text is kept; saving writes it again.",
"editor.reveal.invalidParams": "editor.reveal needs a path (string), line and column (numbers)",
@ -362,6 +377,8 @@
"vcs.changes.noCommits": "no commits yet",
"vcs.changes.noProject": "Open a project to see its changes",
"vcs.changes.noRepo": "This project is not in a Git repository",
"vcs.changes.partly": "partly staged",
"vcs.changes.partlyStaged": "Partly staged: some changes of this file are staged, others are not",
"vcs.changes.renamedFrom": "from {path}",
"vcs.changes.repoError": "The Git repository cannot be read: {reason}",
"vcs.changes.stageFile": "Stage {path}",
@ -393,6 +410,7 @@
"vcs.diff.captionCommit": "{path}: before (left) and after (right) commit {hash}",
"vcs.diff.captionHead": "{path}: last commit (left) and working copy (right)",
"vcs.diff.captionIndex": "{path}: staged version (left) and working copy (right)",
"vcs.diff.chunkHint": "Click a change marker in the gutter to stage, unstage or revert that chunk.",
"vcs.diff.closeTab": "Close the diff of {name}",
"vcs.diff.failed": "The diff cannot be shown: {reason}",
"vcs.diff.invalidParams": "vcs.showDiff takes {path?: string, staged?: boolean}",