M4.9: Git stash (stash, list, apply, pop, drop) with clear refusals

- crates/vcs: stash.rs (append) with Repo::stash, stash_list, stash_apply
  and stash_drop; refusals decided structurally (no commit, nothing to
  stash, unmerged files, conflicts after apply, missing or changed entry)
  plus hints for overwritten and untracked files. Works around git leaving
  untracked files behind under --literal-pathspecs. Repo::lock is
  pub(crate), as for M4.8.
- engine: git.stash, git.stashList, git.stashApply {index, pop, hash?},
  git.stashDrop through the M4.6 hook; gitChanged after changes.
- ui: stash dialog (vcs.stash, vcs.showStashes; Git menu, no shortcuts),
  two buttons in the Changes window, dirty buffers saved first, drop asks.
- Tests: vcs integration and property tests, engine test, 13 Vitest tests.
- Docs: architecture section, G8, tooling checklist, roadmap, Git row
  evidence (score left to the PM).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-10-29 18:49:54 +01:00
parent 65907d925a
commit e09ef8b8c0
23 changed files with 2681 additions and 13 deletions

View file

@ -38,6 +38,8 @@
"command.vcs.showDiff": "Show Diff",
"command.vcs.showHistory": "Show History",
"command.vcs.showLog": "Log",
"command.vcs.showStashes": "Stashes…",
"command.vcs.stash": "Stash Changes…",
"command.view.toggleProjectTree": "Show or Hide Project",
"command.view.toggleStructure": "Show or Hide Structure",
"common.cancel": "Cancel",
@ -190,6 +192,10 @@
"notification.vcs.pushedUpstream": "Pushed {branch} to {remote} and set it as the upstream",
"notification.vcs.remoteCancelled": "Git operation cancelled",
"notification.vcs.resolved": "Marked {path} as resolved",
"notification.vcs.stashApplied": "Applied {name}",
"notification.vcs.stashDropped": "Dropped {name}",
"notification.vcs.stashPopped": "Applied and dropped {name}",
"notification.vcs.stashed": "Stashed the local changes: {message}",
"notification.vfs.pumpFailed": "Applying changes on disk failed: {reason}",
"notification.watch.failed": "Lutra stopped watching the project for changes on disk: {reason}",
"palette.label": "Command palette",
@ -467,6 +473,26 @@
"vcs.remotes.url": "URL of the new remote",
"vcs.remotes.urlEmpty": "Enter the new URL.",
"vcs.remotes.urlOf": "URL of {name}",
"vcs.stash.apply": "Apply",
"vcs.stash.applyHint": "Apply the selected entry and keep it (Enter)",
"vcs.stash.drop": "Drop",
"vcs.stash.dropHint": "Delete the selected entry (Delete)",
"vcs.stash.dropQuestion": "Drop {name}? It cannot be restored.",
"vcs.stash.empty": "The stash is empty.",
"vcs.stash.includeUntracked": "Include untracked files",
"vcs.stash.listTitle": "Stashes",
"vcs.stash.loading": "Reading the stash…",
"vcs.stash.message": "Message",
"vcs.stash.messagePlaceholder": "Optional; Git names the entry after the last commit without one",
"vcs.stash.newStash": "Stash changes…",
"vcs.stash.notSaved": "Nothing was done: not every file could be saved first.",
"vcs.stash.note": "Every local change of the repository is set aside and the files go back to the last commit. Unsaved files are saved first.",
"vcs.stash.pop": "Pop",
"vcs.stash.popHint": "Apply the selected entry and drop it if it applies cleanly",
"vcs.stash.showList": "Show stashes…",
"vcs.stash.stash": "Stash",
"vcs.stash.title": "Stash Changes",
"vcs.stash.wip": "WIP: {message}",
"vcs.state.added": "added",
"vcs.state.conflicted": "conflicted",
"vcs.state.copied": "copied",