Skip to content

feat(snippets): implement the svn ice with native git - #5

Open
vladdoster wants to merge 15 commits into
mainfrom
remove-svn-dependency
Open

feat(snippets): implement the svn ice with native git#5
vladdoster wants to merge 15 commits into
mainfrom
remove-svn-dependency

Conversation

@vladdoster

Copy link
Copy Markdown
Owner
  • GitHub retired its Subversion bridge in January 2024. .zinit-mirror-using-svn is now a
    blobless, depth-1 git fetch whose sub-tree is committed as a root commit and checked out,
    reproducing the flat layout svn checkout gave with a clean git status. Subversion is
    neither used nor required; the ice name stays for compatibility.
  • Existing .svn working copies migrate in place on the next update. A failed first download
    rolls back completely; a failed migration leaves the installed snippet untouched.
  • zinit status prints the last commit plus local modifications for directory snippets and still
    answers "is this stale?" via a ref-advertisement probe of the upstream sub-tree. reset''/-r
    uses git reset --hard.
  • Directory snippets are detected via ._zinit/mode instead of probing for .svn, and
    zinit snippet now fails on a failed download instead of registering a snippet that isn't there.
  • zinit version falls back to VERSION + short sha when git describe --tags finds no
    reachable tags (shallow / --no-tags clones).
  • New tests/svn.zunit covers download, turbo load, update, status, reset, delete and the failure
    paths; README and doc/zinit.1 drop Subversion from the ice and command tables.

The suite drives real clones through the code under test, so unset GIT_CONFIG
and friends and point GIT_CONFIG_GLOBAL at the test directory — `git config'
honours GIT_CONFIG as an implicit `--file' and would otherwise write to the
config of whoever runs the tests.

Clone with --reference on the main checkout's object store rather than the
top-level directory, so the suite also runs from a linked worktree.

Move the not_exists assertion out of tests/ices.zunit into the bootstrap,
where zunit's assert dispatch makes it available to every test file, and add
nocolor() for matching against +zi-log output.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
.zinit-two-paths probed for .svn to tell a directory snippet from a file
snippet, which stops working once the backend no longer creates one. Probe
._zinit/mode (and its legacy ._zplugin spelling) instead, keeping .svn as a
fallback for working copies downloaded before the switch.

Deliberately not probing for .git: unlike .svn it isn't zinit-exclusive, so a
single-file snippet whose atclone'' runs `git init' would be misclassified.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
GitHub retired its Subversion bridge in January 2024. Reimplement
.zinit-mirror-using-svn as a blobless, depth-1 fetch whose sub-tree is
committed as a root commit and checked out, reproducing the flat layout
`svn checkout' gave with a clean `git status'. Add .zinit-parse-svn-url to
split /trunk/, /branches/ and /tags/ URLs into a (repository, ref,
sub-directory) triple.

Existing .svn working copies are migrated in place on the next update; a
failed first download is rolled back, while a failed migration leaves the
installed snippet untouched. Implement reset''/-r with `git reset --hard',
and propagate .zinit-download-snippet's error code 4 so that `zinit snippet'
fails on a failed download instead of registering a snippet that isn't there.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
`zinit status' ran `svn status -vu' on directory snippets. Print the last
commit and any local modifications instead, and keep answering the question
`svn status -vu' answered — is this snippet stale? — with a ref-advertisement
probe of the upstream sub-tree. Snippets not yet migrated from Subversion say
so rather than failing obscurely.

Drop Subversion from the help text and from the list-snippets labels.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Pin down the on-disk contract and the load semantics of directory snippets —
download, turbo load, update, status, reset, delete and the failure paths —
rather than the transport. Register the suite in the tests workflow matrix.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Drop Subversion from the svn/atpull/reset ice tables and from the status and
update command tables, and point the Oh-My-Zsh example at the renamed macos
plugin.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
`zinit version' printed a bare DIFF marker before the version line. It was
debugging residue from the svn-to-git work and never meant to ship.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
`git describe --tags' fails outright on a clone made with --depth or
--no-tags, so `zinit version' printed a fatal error and an empty version.
The test suite clones exactly that way, and it now runs `zinit version'
during bootstrap.

Fall back to the VERSION file plus the short sha, keeping the shape
`describe' would have produced, and report `unknown' rather than borrowing a
version from an enclosing repository when BIN_DIR holds no repository at all.

Replace --git-dir=$(realpath …/.git) with `git -C': a linked worktree and a
submodule have a .git file rather than a directory.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
@vladdoster vladdoster self-assigned this Jul 25, 2026
@vladdoster
vladdoster force-pushed the remove-svn-dependency branch 2 times, most recently from 9818d89 to ffe8aae Compare July 25, 2026 04:16
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
@vladdoster
vladdoster force-pushed the remove-svn-dependency branch from ffe8aae to c33288b Compare July 25, 2026 04:20
Skip tj/mmake when no x86_64-capable make is available, keep ERR_EXIT
from aborting the hook-handler setup, strip color before asserting on
the ice suffix list and pre-install zdharma-continuum/null, and disable
jemalloc for the macOS tmux build.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
These tests are ordered download-first/delete-last and share disk
state, so the header warned against running the file with `zunit -p'
at all. zunit now treats a test file as a single unit of work, which
makes -p safe here; what breaks the file is --slice, where every
worker sources the bootstrap and so gets its own empty $zi_test_dir.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Each test now declares what it needs up front -- `discard' for the
snippets whose download it asserts on, `provide_macos' for the ones it
only reads, and `ensure_snippets_home' for the $SNIPPETS skeleton that
`zinit delete' sweeps away. Declaration order is a readability choice
again rather than a contract, so the file is safe under `zunit -p',
`--slice' and `--slice -p' alike, which reverses the warning added in
337d308.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Each matrix job runs one test file, so --slice is what parallelizes the
work inside it. tests/svn.zunit was the last file that could not be
split -- every worker sources the bootstrap and gets its own empty
$zi_test_dir -- and 07580cf made each of its tests declare what it
needs up front, so the flag is now safe suite-wide.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
5101628 turned on --slice for every matrix job, but only gh-r and
plugins are large enough for the worker startup cost to pay for itself.
Move the flag into a matrix.zunit_flag set by an include block, so the
other seven suites run zunit unsliced.

Drops the hardcoded --verbose along with it; verbosity belongs in
.zunit.yml.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant