Skip to content

feat: lazy dependencies, placed only once something asks for them - #5

Merged
antonzherdev merged 4 commits into
mainfrom
anton/lazy-entries
Oct 23, 2026
Merged

antonzherdev merged 4 commits into
mainfrom
anton/lazy-entries

Conversation

@antonzherdev

@antonzherdev antonzherdev commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Lazy dependencies: a repository only some work needs stays off disk, with nothing fetched, until something asks for it. A workspace repository can declare every repository a team has, and each task checks out only what it touches.

"imports/fixtures" = { url = "git@github.com:org/fixtures.git", revision = "v3", lazy = true }

The config commits the default; git scale prefer --lazy|--eager overrides it per workspace, beside the existing form preference, so --lazy --artefact installs an image only when named. prefer --unset removes both.

A lazy repository is placed when, first match wins:

  1. a command names it (git topic join DIR, git scale sync DIR, in CI also an earlier command of the same job), it is on disk outside CI, or the topic has its branch (or <topic>@vN) locally or on the remote;
  2. the workspace prefers --eager, or --lazy, which never overrides another repository's request without lazy;
  3. every request for it says lazy = true.

On a topic the lazy remotes are asked in parallel. One that cannot be asked fails CI and git scale check; locally it is a warning and the repository stays out. Offline commands and the git hooks read the store instead. prefer --lazy, and leave/finish for a checkout join brought from nothing, remove it when nothing would be lost; an unreadable status keeps it. git upgrade DIR raises one that is not placed.

Tests: tests/it/lazy.rs (24). Not covered: a lazy repository wanted at two majors at once; ignored files go with a removed checkout.

Topic state for a root with no commits is #8. Every open PR regenerates docs/test-catalog.md: whichever merges later reruns GITSCALE_UPDATE_CATALOG=1 cargo test --test it catalog::.

https://claude.ai/code/session_018fr6kum7myDDnc3cmS6TfH

@antonzherdev
antonzherdev force-pushed the anton/lazy-entries branch 2 times, most recently from f62b922 to 5812c97 Compare September 30, 2026 01:29
@antonzherdev
antonzherdev marked this pull request as ready for review September 30, 2026 01:36
@antonzherdev antonzherdev changed the title feat: lazy entries, fetched only when named feat: lazy entries, and a topic's state from its joined checkouts Oct 23, 2026
@antonzherdev antonzherdev changed the title feat: lazy entries, and a topic's state from its joined checkouts feat: lazy dependencies, a presence preference, and a topic's state from its joined checkouts Oct 23, 2026
@antonzherdev antonzherdev changed the title feat: lazy dependencies, a presence preference, and a topic's state from its joined checkouts feat: lazy dependencies, placed only once something asks for them Oct 23, 2026
`lazy = true` on an entry leaves the repository out of every placement,
with nothing fetched for it, until a command names it (`git scale sync
DIR`, `git topic join DIR`), it is on disk, the topic has a branch of it
here or on its remote, or another repository asks for it without `lazy`.
A workspace overrides the configs with `git scale prefer --lazy|--eager`,
and `--committed` hands the choice back; the form preference is unchanged,
so a lazy artefact installs its image when named.

On a topic, every lazy repository's remote is asked for the topic's branch
with one ref advertisement, side by side; one that cannot be asked fails
the command rather than reading as "no branch", so `check` cannot pass
over a change it did not see. A lazy repository requested under several
names is placed and found under one directory, as an implicit checkout
is. `prefer --lazy` never takes away what another repository needs, and
says which. `prefer --lazy`, and `leave` and `finish` for a checkout
`join` brought from nothing, remove it when that loses nothing, an
artefact's image included. `ls` shows a repository left out as `lazy`,
and `require --lazy` writes the flag.

Claude-Session: https://claude.ai/code/session_018fr6kum7myDDnc3cmS6TfH
Anton Zherdev added 2 commits October 23, 2026 09:57
…esence

Named after `git config --unset`: `git scale prefer --unset DIR...` drops
everything this workspace recorded for those repositories, so the configs
decide again, and takes no other option beside it. It replaces
`--committed`, which only reset the presence. `--source` still drops the
form preference alone.

Claude-Session: https://claude.ai/code/session_018fr6kum7myDDnc3cmS6TfH
…aises one left out

In CI, `sync DIR` placed a lazy repository and then failed in its own
scrub step, which resolved again without the name; the next plain `sync`
removed it. The scrub now cleans against the placement's resolution, and
the repositories a job names are recorded under its job id, so its later
commands keep them while a build directory reused by another job does not.

`git upgrade DIR` on a lazy dependency that is not placed failed with "not
a checkout of this workspace"; it now names it to resolution, as `sync`
and `join` do.

Claude-Session: https://claude.ai/code/session_018fr6kum7myDDnc3cmS6TfH
@antonzherdev
antonzherdev merged commit 60fdbb7 into main Oct 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant