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:
parent
65907d925a
commit
e09ef8b8c0
23 changed files with 2681 additions and 13 deletions
|
|
@ -7,7 +7,8 @@
|
|||
* - **Status line:** the branch (or the short hash when detached) and the
|
||||
* counts, or why there is nothing to show: git missing or too old (with
|
||||
* a hint to the setting `git.executable`), no repository, no changes.
|
||||
* A refresh button runs `vcs.refresh`.
|
||||
* A refresh button runs `vcs.refresh`; two more open the stash dialog
|
||||
* (M4.9) on its form (`vcs.stash`) and on its list (`vcs.showStashes`).
|
||||
* - **Groups:** a header with a checkbox that stages (Changes, Untracked)
|
||||
* or unstages (Staged) the whole group, then the files. Each file has a
|
||||
* checkbox doing the same for itself, its name coloured by its state
|
||||
|
|
@ -26,7 +27,7 @@
|
|||
* message survive hiding the window. Icons are Lucide's; colours are
|
||||
* tokens.
|
||||
*/
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
import { Archive, ArchiveRestore, RefreshCw } from "@lucide/vue";
|
||||
import { computed, nextTick, onMounted, ref, watch } from "vue";
|
||||
import { useCommandsStore } from "../../../commands/store";
|
||||
import { isMac } from "../../../commands/keymap";
|
||||
|
|
@ -325,6 +326,28 @@ watch(
|
|||
>
|
||||
<RefreshCw :size="14" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="changes__icon-button"
|
||||
:title="t('command.vcs.stash')"
|
||||
:aria-label="t('command.vcs.stash')"
|
||||
:disabled="changes.phase !== 'ready' || !commands.isEnabled('vcs.stash')"
|
||||
data-test="changes-stash"
|
||||
@click="commands.execute('vcs.stash')"
|
||||
>
|
||||
<Archive :size="14" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="changes__icon-button"
|
||||
:title="t('command.vcs.showStashes')"
|
||||
:aria-label="t('command.vcs.showStashes')"
|
||||
:disabled="changes.phase !== 'ready' || !commands.isEnabled('vcs.showStashes')"
|
||||
data-test="changes-stashes"
|
||||
@click="commands.execute('vcs.showStashes')"
|
||||
>
|
||||
<ArchiveRestore :size="14" />
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
v-if="changes.phase === 'unavailable'"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue