Expand description
MR.2: which repository each magit buffer is acting on.
A magit buffer’s name carries the repository’s basename because
that is what a user recognises in :ls. A basename cannot round-trip
to a path and two checkouts can share one, so the name is not the
source of truth — this is (design §3.1). The trigger resolves the
repository and records it here; the view reads it back when it
activates, and (MR.4) every action body in that buffer reads it
instead of re-resolving.
Keyed by buffer name, not id. The trigger runs before the
buffer exists — that is the whole reason a side channel is needed at
all (on_activate cannot see what the trigger saw) — so there is no
id to key on yet. BufferStore::name_for then makes id → name →
workdir a lookup rather than a second map to keep in sync.
Not one-shot. ViewArgsRequests and BlameRequests, the two
side channels this shape comes from, are taken on activation
because a request is for one activation. This one is read for the
buffer’s whole life: s in a status buffer stages into the repo the
buffer is showing, every time it is pressed, or the buffer is worse
than it was before MR.2 (design §4).
Structs§
- Repo
Scopes - Buffer name → the repository that buffer acts on.
Functions§
- action_
workdir active_workdirfor an action handler, which carries the services rather than the handles.- active_
workdir - MR.4: the repository an action acts on — the one question every magit action body asks, answered in one place.
- label_
of_ buffer - MR.3b: the repository label a magit buffer’s own name carries, for a producer that has the buffer store but no services.
- open_
repo_ view - MR.2: the single path from “a magit trigger fired” to “the buffer it opens” — resolve the repository, name the buffer for it, record which repository that buffer acts on.
- open_
repo_ view_ at - PC.3:
open_repo_viewfor a repository named EXPLICITLY. - open_
repo_ view_ with - MR.3:
open_repo_viewfor a view that encodes parameters of its own — the commit family’s target (*magit:augment:<repo>:<sha>*) and, from MR.3b, the path- and revision-scoped views. - repo_
view_ name - The naming half of
open_repo_view, split out so a test can assert which buffer a trigger lands on without anEffectin the way. - repo_
view_ name_ at - PC.3:
repo_view_namefor an explicitly-named repository. - repo_
view_ name_ with - Resolve the repository, compose the name, record what the buffer acts on. The single body under every magit trigger.
- view_
workdir - MR.3: the repository a magit view acts on, read at activation — the
other end of what
open_repo_viewwrote. - workdir_
or_ cwd active_workdirwith the working directory as the fall-back — the form the operation helpers want, since they need a directory to run git in and “not in a repository” is git’s error to report, not ours.
Type Aliases§
- Repo
Scopes Handle - Typed handle for
ServiceRegistrylookup — register and look up under THIS alias (feedback_servicesregistry_arc_typeid).