git.mergeMessage reads MERGE_MSG without its comment lines while a merge
is in progress. The Changes window fills an empty box with it once per
merge when conflicts show up, and again on vcs.commit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- crates/vcs: blame.rs (git blame --porcelain, --contents - from a
buffer, revisions, untracked files and empty repositories give no
lines; property-tested parser, ISO dates without a date crate)
- engine: git.blame {path, rev?} -> {lines, version} through start_with;
an open buffer is blamed as it would be saved (line ending, BOM)
- ui: blame.ts gutter toggled per file (vcs.toggleBlame, Git menu, no
shortcut), date + author per run, bar coloured by age from tokens,
hover card with the full commit message, click opens the commit in
the Log (vcs.showCommit); refreshed on edits and gitChanged
- docs: architecture "Blame (M4.7)"
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 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>
Backend (crates/vcs/src/merge.rs, cmd/git_merge.rs via start_with):
git.merge {branch} -> {result: merged|upToDate|conflicts, conflicts},
git.mergeAbort, git.conflictVersions {path} -> {base?, ours, theirs,
binary, tooLarge} from the index stages :1:/:2:/:3:, git.markResolved
{paths}. Repo::lock becomes pub(crate) so merge and abort hold the
mutation lock.
UI (ui/src/components/vcs/merge/): merge dialog with branch picker,
conflicts list from the shared status store, a three-pane resolve view
(ours / editable result / theirs) with accept left/right per chunk,
accept all, previous/next conflict, Apply through the file's buffer then
mark resolved, keep-a-side for modify/delete, abort after confirmation.
Own three-way line merge on @codemirror/merge's diff. UI commands
vcs.merge, vcs.resolveConflicts, vcs.abortMerge (no default shortcuts);
the Changes window opens conflicted rows in the resolve view.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner decision D23: Lutra runs fetch, pull (merge or rebase per the new
git.pull.mode setting), push (upstream set on the first push) and clone
through the user's git. Any HTTPS or SSH server works; sign-in stays with
git's credential helper (its own window is allowed for network calls only)
and the ssh agent. Terminal prompts stay off, ext:: is refused, and URL
userinfo is redacted in every message, progress line and remote listing.
- vcs: Call::network with a 30 min timeout, a stderr progress sink and a
Cancel flag that kills git's process group; remote.rs with clone_repo,
fetch, pull, push (--porcelain rejections), remotes and add/set-url/
remove; explained refusals (rejected push, sign-in, host key, not found,
unreachable, no upstream, local changes, conflicts).
- engine: git.fetch/pull/push/clone/cancel/remotes/remoteAdd/remoteSetUrl/
remoteRemove, one network call at a time, gitProgress events,
gitChanged after changes.
- ui: status-bar progress with Cancel and ahead/behind, vcs.fetch/pull/
push/clone/manageRemotes (Git menu, no default shortcuts), Clone
Repository and Manage Remotes dialogs; desktop pick_dir IPC.
- Tests against local bare repositories only (vcs 8, engine 3, Vitest 11)
plus unit and property tests; docs updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- crates/vcs log.rs: Repo::log (topological, all refs, paging, literal
message/author filters, a path's history with --follow), show_commit
(message and files against the first parent, renames) and show_at
(a file at any commit); parsers property-tested.
- Engine git.log, git.showCommit, git.showAt in cmd/git_log.rs through
the step-1 hook.
- Log tab in the bottom panel: graph lanes carried across pages, ref
badges, filters, lazy paging, keyboard; commit details whose files open
a read-only diff at that commit in M4.3's viewer.
- vcs.showLog and vcs.showHistory (menu, tree context menu, active
editor tab), no default shortcuts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Repo::run, check_name and SMALL_CAP become pub(crate); cmd/git.rs gains
Op::Custom, start_with and a pub(super) rel_path, so a new module adds an
Op::Custom through start_with instead of editing git.rs or repo.rs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- vcs: checking out a remote-tracking branch reads remote.<name>.fetch;
without a matching refspec it creates the local branch with --no-track
instead of leaving a dirty tree after git fails to set up tracking.
- vcs + engine: git.lastMessage returns HEAD's full message (null before
the first commit); the Changes window prefills Amend with it.
- ui: stores/vcsStatus.ts is the only git.status caller; the Changes
window, tree/tab colours and the branch item read its snapshot, so a
gitChanged costs one status query. RepoSummary carries upstream,
ahead and behind.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New crate lutra-vcs (L3): a safe git runner (argument arrays, no prompts,
GIT_OPTIONAL_LOCKS=0 for reads, timeouts 30 s / 120 s for hooks, output
caps, one spawn function for H1's kill-on-close helper), porcelain v2 / -z
parsers (property-tested), Repo operations (status, stage, unstage before
the first commit, commit and amend, show at HEAD/index, branches, checkout
with remote tracking, branch creation checked by check-ref-format) and a
.git poll (RepoWatch).
Engine: git.status, git.stage, git.unstage, git.commit, git.show,
git.branches, git.checkout, git.createBranch on pending outcomes, off the
engine lock; gitChanged after changes and debounced 300 ms on .git or
project changes; setting git.executable (section Git).
Tests against real temp repositories, engine tests through run_waiting,
docs (architecture, gaps G8, Git parity row, roadmap M4 row).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>