Commit graph

3975 commits

Author SHA1 Message Date
Vladislav Doster a1cf6128c2 test: pin core.eol=lf for the test environment
With the text attribute set, core.autocrlf=false hands the decision to
core.eol, so a global core.eol=crlf still produces CRLF checkouts in the
sandbox clones.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-08-27 03:29:50 -05:00
Vladislav Doster 8f4e888328 ci: add hook-handler and ice-validation to matrix
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-08-27 03:28:26 -05:00
Vladislav Doster a4c01374a9 build: use text=auto for the default attribute
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-08-27 03:28:26 -05:00
Vladislav Doster 4d98cd4563 test(ice-validation): fix two assertions that could not hold
wait-invalid-suffix-x asserted on 'Expected one of: a, b, c', but
+zi-log colourises each suffix letter separately, so the raw output
carries escape sequences between them and no such contiguous substring
exists. Strip the escapes before asserting on the sentence.

for-invalid-as asserted rc 0 while the load ran on to
∞zinit-compile-plugin-hook, which returns 1 for this fixture ("No files
for compilation found") and made `zinit for' exit 1 for a reason
unrelated to the invalid ice under test. Add nocompile so the test
measures ice validation only.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-08-27 03:28:26 -05:00
Vladislav Doster 116d30bfc8 test(hook-handler): stop re-sourcing zinit.zsh in @setup
@setup bodies run under ERR_EXIT. Sourcing zinit.zsh trips it partway
through, so the setup aborted and zunit reported both tests as failures
with an empty message -- which read as a broken assertion rather than a
broken fixture. The source was redundant anyway: the bootstrap already
sources zinit from the sandbox clone.

Drop the ZINIT[BIN_DIR]="$PWD" override with it. It aimed the tests at
the real checkout instead of the sandbox, the same misdirection that
lets a failed bootstrap write into the working tree. Neither test calls
a zinit function; only the hook registries are needed.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-08-27 03:28:26 -05:00
Vladislav Doster 8f01c1d451 test(ices): add $OLDPWD regression coverage for ice loading
Covers atload, atinit and multisrc, the nocd branch, a since-deleted
$OLDPWD, an $OLDPWD that started unset, and the configure hook.

Each test asserts where `cd -' actually lands, not just the value of
$OLDPWD: `cd -' reads zsh's internal previous-directory state, so a
parameter-only assertion passes against a fix that merely assigns
$OLDPWD while leaving the bug in place. All seven fail without the
preceding two commits.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-08-27 03:28:26 -05:00
Vladislav Doster d875651d59 fix(install): restore cwd after the configure hook
∞zinit-configure-base-hook cd'd into the plugin directory inside a plain
{ } block -- not a subshell -- and every one of its four return paths
left the shell parked there. A `zinit update' on a plugin using the
configure ice moved the user's shell and never moved it back.

Wrap the block in an always clause so the directory is restored on all
paths, and use .zinit-cd-quiet instead of a bare `cd --', which was also
firing chpwd hooks and AUTO_PUSHD.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-08-27 03:28:26 -05:00
Vladislav Doster 712cac1952 fix(ices): restore $OLDPWD around plugin directory hooks
Every ice that runs code inside a plugin or snippet directory (atinit,
atload, multisrc, atclone, atpull, ps-on-unload) saved and restored $PWD
around the temporary cd, but never $OLDPWD. `cd -q' suppresses chpwd
hooks and `noautopushd' suppresses the directory stack, but neither
suppresses $OLDPWD, so the cd back left it pointing at the directory
just visited. Opening a new shell and pressing `cd -' jumped into a
zinit plugin directory without the user ever having gone there.

Add .zinit-cd-quiet/.zinit-restore-dir, which return to the original
$PWD by cd'ing through the original $OLDPWD for real. A plain $OLDPWD
assignment is not enough: `cd -' reads zsh's internal previous-directory
state, not the parameter, so assigning it leaves the parameter looking
correct while `cd -' still navigates to the plugin directory. When the
original $OLDPWD is empty or has since been deleted, bounce through
$PWD instead, which degrades `cd -' to a harmless no-op rather than
emitting an error and leaking the plugin directory anyway.

Also gate the restore on the cd having actually happened. It ran
unconditionally, so with the nocd ice -- where no cd takes place -- the
no-op cd back to $PWD still set OLDPWD=$PWD, silently discarding the
user's real previous directory.

Sites already protected by a real subshell, and the user-facing `zinit
cd' and `zinit create' commands that are meant to leave you in the
target directory, are left untouched.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-08-27 03:28:26 -05:00
dependabot[bot] 6842df0082
build(deps): bump Homebrew/actions/setup-homebrew from 2026.08.14.1 to 2026.08.24.1 (#809)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-26 08:45:36 +02:00
dependabot[bot] fc234da3ad
build(deps): bump Homebrew/actions/setup-homebrew from 2026.08.10.2 to 2026.08.14.1 (#807)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-18 09:09:14 +02:00
vladislav doster fb12fbc83a
Merge pull request #806 from zdharma-continuum/dependabot/github_actions/Homebrew/actions/setup-homebrew-2026.08.10.2
build(deps): bump Homebrew/actions/setup-homebrew from 2026.08.10.1 to 2026.08.10.2
2026-08-14 17:07:49 -05:00
dependabot[bot] 7d94266c9d
build(deps): bump Homebrew/actions/setup-homebrew
Bumps [Homebrew/actions/setup-homebrew](https://github.com/homebrew/actions) from 2026.08.10.1 to 2026.08.10.2.
- [Release notes](https://github.com/homebrew/actions/releases)
- [Changelog](https://github.com/Homebrew/actions/blob/main/release.test.mts)
- [Commits](c8707045cc...b35a29a0f8)

---
updated-dependencies:
- dependency-name: Homebrew/actions/setup-homebrew
  dependency-version: 2026.08.10.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-13 12:02:38 +00:00
dependabot[bot] 488b07e766
build(deps): bump EndBug/add-and-commit from 10 to 11 (#805)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-13 08:43:58 +02:00
dependabot[bot] feba951c29
build(deps): bump Homebrew/actions/setup-homebrew from 2026.08.03.2 to 2026.08.10.1 (#804)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-11 23:01:29 +02:00
dependabot[bot] 571722af95
build(deps): bump Homebrew/actions/setup-homebrew from 2026.07.20.1 to 2026.08.03.2 (#802)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-06 14:03:31 +02:00
dependabot[bot] ded3d6eef0
build(deps): bump Homebrew/actions/setup-homebrew from 2026.07.10.1 to 2026.07.20.1 (#798)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-28 07:00:23 +02:00
vladislav doster e4b5083c7c
Merge pull request #797 from zdharma-continuum/ci/lint-commit-message
ci(style): Add commit convention job to linting workflow
2026-07-25 15:33:07 -05:00
vladislav doster 41e55eb833
ci(style): Add commit convention job to linting workflow 2026-07-25 15:31:00 -05:00
vladislav doster 824e18d4b9
Merge pull request #796 from zdharma-continuum/ci/fix-tests
ci(tests): parallelize zunit runs and pin CI toolchain
2026-07-25 11:14:35 -05:00
vladislav doster 7e2bb9f826
ci: disable verbose output and parallel execution in zunit
Updated zunit configuration to disable verbose output and parallel execution.
2026-07-25 11:09:52 -05:00
vladislav doster 1bd68690d4
ci(tests): parallelize zunit runs and pin CI toolchain
- Check out zdharma-continuum/zunit at feat/run-tests-in-parallel-support and
  run the gh-r and plugins suites with --slice
- Pin Homebrew/actions/setup-homebrew to a commit SHA and enable its sandbox
- Drop ncurses from the brew install list, relink it explicitly, and add
  jemalloc; set HOMEBREW_NO_REQUIRE_TAP_TRUST
- Expand the OS matrix to "${os}-latest" and label jobs as "<test> | <os>"

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-07-25 10:45:26 -05:00
vladislav doster a7999260ea
Merge pull request #794 from zdharma-continuum/dependabot/github_actions/actions/labeler-7
build(deps): bump actions/labeler from 6 to 7
2026-07-21 20:43:57 -05:00
dependabot[bot] 66336e30f3
build(deps): bump actions/labeler from 6 to 7
Bumps [actions/labeler](https://github.com/actions/labeler) from 6 to 7.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/labeler
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-21 12:02:31 +00:00
dependabot[bot] 9b7ffc15ad
build(deps): bump actions/setup-python from 6 to 7 (#793)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-20 14:03:28 +02:00
onice b1176045f9
docs: document compile execution order (#789) 2026-07-18 05:04:36 -05:00
dependabot[bot] e347224fb5
build(deps): bump actions/setup-node from 6 to 7 (#790)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-14 15:20:25 +02:00
dependabot[bot] fcd2501fa3
build(deps): bump dawidd6/action-homebrew-bump-formula from 7 to 8 (#788)
Some checks failed
Container images / build-containers-with-zsh (5.8) (push) Has been cancelled
Container images / build-containers-with-zsh (5.9) (push) Has been cancelled
Container images / build-container-latest (push) Has been cancelled
Documentation / zshelldoc (push) Has been cancelled
lint / markdown (push) Has been cancelled
lint / zsh (noexec) (push) Has been cancelled
lint / zsh (zcompile) (push) Has been cancelled
tests / ${{ matrix.zunit_test }} (macos-latest, annexes) (push) Has been cancelled
tests / ${{ matrix.zunit_test }} (macos-latest, commands) (push) Has been cancelled
tests / ${{ matrix.zunit_test }} (macos-latest, compile) (push) Has been cancelled
tests / ${{ matrix.zunit_test }} (macos-latest, config-zstyle) (push) Has been cancelled
tests / ${{ matrix.zunit_test }} (macos-latest, gh-r) (push) Has been cancelled
tests / ${{ matrix.zunit_test }} (macos-latest, ices) (push) Has been cancelled
tests / ${{ matrix.zunit_test }} (macos-latest, plugins) (push) Has been cancelled
tests / ${{ matrix.zunit_test }} (macos-latest, snippets) (push) Has been cancelled
tests / ${{ matrix.zunit_test }} (ubuntu-latest, annexes) (push) Has been cancelled
tests / ${{ matrix.zunit_test }} (ubuntu-latest, commands) (push) Has been cancelled
tests / ${{ matrix.zunit_test }} (ubuntu-latest, compile) (push) Has been cancelled
tests / ${{ matrix.zunit_test }} (ubuntu-latest, config-zstyle) (push) Has been cancelled
tests / ${{ matrix.zunit_test }} (ubuntu-latest, gh-r) (push) Has been cancelled
tests / ${{ matrix.zunit_test }} (ubuntu-latest, ices) (push) Has been cancelled
tests / ${{ matrix.zunit_test }} (ubuntu-latest, plugins) (push) Has been cancelled
tests / ${{ matrix.zunit_test }} (ubuntu-latest, snippets) (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-03 17:09:51 +02:00
Vladislav Doster 429ab13631 release: v3.14.0 → v3.15.0
# [3.15.0](https://github.com/zdharma-continuum/zinit/compare/v3.14.0...v3.15.0) (2026-07-01)

### Bug Fixes

* .zi-check-for-git-changes runs git fetch before checking for changes ([1107460](1107460bcd))
* add markdownlint exceptions to linting ([507b4e5](507b4e5722))
* avoid apostrophe that breaks typeset -f round-trip of :zinit-tmp-subst-autoload ([#783](https://github.com/zdharma-continuum/zinit/issues/783)) ([d2d4237](d2d4237715))
* correct SSH URL format for private repos ([#721](https://github.com/zdharma-continuum/zinit/issues/721)) ([991e4a8](991e4a816e))
* corrected print-out message in self-update routine ([bb37f3b](bb37f3bbd8))
* impl gh-r version detection using GitHub API ([#731](https://github.com/zdharma-continuum/zinit/issues/731)) ([f1e503d](f1e503dc3b)), closes [#r](https://github.com/zdharma-continuum/zinit/issues/r)
* prevent "permission denied" errors from empty hook handlers ([#729](https://github.com/zdharma-continuum/zinit/issues/729)) ([2167408](2167408db2))
* prevent double extraction when exclamation mark modifier is used in extract'!' ([4fd38b3](4fd38b34e7)), closes [#r](https://github.com/zdharma-continuum/zinit/issues/r) [#r](https://github.com/zdharma-continuum/zinit/issues/r)
* remove `local -A OPTS` that shadows caller's parallel flag ([#774](https://github.com/zdharma-continuum/zinit/issues/774)) ([e88ed77](e88ed77319))
* resolve a bug where the `-q` option for quiet mode was never dispatched ([6cf2f29](6cf2f2990d))
* resolve a second issue where `git -C <path>` had to be used instead of `git --work-tree <path>` ([2e83176](2e83176b23))
* resolves a bug with github action trying to push updated docs back to external forks ([#763](https://github.com/zdharma-continuum/zinit/issues/763)) ([34a1811](34a18112e8))
* silenced `zinit self-update` when in quiet mode (`-q`) ([8d154b0](8d154b0609))
* trust archive permissions instead of `file(1)` heuristics in `ziextract` ([#771](https://github.com/zdharma-continuum/zinit/issues/771)) ([1334994](1334994f20))
* update `git-chglog` to `git-cliff` in gh-r tests ([18fc2cc](18fc2cc5b9)), closes [#r](https://github.com/zdharma-continuum/zinit/issues/r)
* Update various tools in gh-r tests ([#759](https://github.com/zdharma-continuum/zinit/issues/759)) ([01eb65f](01eb65f8ce)), closes [#r](https://github.com/zdharma-continuum/zinit/issues/r)

### Features

* validate ice arguments ([#778](https://github.com/zdharma-continuum/zinit/issues/778)) ([424b241](424b241bc7))
* **zsh:** allow configuring settings like HOME_DIR/BIN_DIR via zstyle ([8f89f88](8f89f88cfd))
2026-07-01 00:40:22 +00:00
vladislav doster fbf511804c
Merge pull request #785 from zdharma-continuum/worktree-agent-a8f829c0814f3ef51
feat(zsh): configure ZINIT settings (`HOME_DIR`, `BIN_DIR`, …) via zstyle
2026-06-30 19:38:55 -05:00
vladislav doster 66211de7a3
Merge branch 'main' into worktree-agent-a8f829c0814f3ef51 2026-06-26 21:50:33 -05:00
vladislav doster ed04c9cafe
Merge pull request #786 from zdharma-continuum/dependabot/github_actions/actions/checkout-7
build(deps): bump actions/checkout from 6 to 7
2026-06-19 12:10:17 -05:00
dependabot[bot] 0ab1ee4fb7
build(deps): bump actions/checkout from 6 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-19 12:02:28 +00:00
vladdoster 8f89f88cfd feat(zsh): allow configuring settings like HOME_DIR/BIN_DIR via zstyle
Resolve ZINIT[...] settings from `zstyle ':zinit:config' <attr>` before
the BIN_DIR/HOME_DIR/derived-dir logic runs. The attribute name is the
hash field lowercased with `_` replaced by `-` (HOME_DIR -> home-dir).

An explicitly-set ZINIT[KEY] always wins over zstyle, which wins over
the built-in default; fully backward-compatible.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-06-18 19:05:42 -05:00
Agusti F. d2d4237715
fix: avoid apostrophe that breaks typeset -f round-trip of :zinit-tmp-subst-autoload (#783) 2026-06-15 13:54:18 +02:00
Andrea Alberti c51a835a21
Document the e- / no-e- prefix on atpull hook-group names, and fix a mislabeled section header (#781) 2026-06-01 09:05:22 +02:00
Andrea Alberti 27a0dc5527
## Fix extract ice not working during zinit update for from'gh-r' (#780) 2026-05-30 22:39:06 +02:00
Andrea Alberti 17f2c4bc74
test: replace cog gh-r test with cosign
replicate/cog stopped shipping a static binary in its GitHub releases
(switched to a Python wheel coglet-*.whl as of v0.20.0), which broke the
linux gh-r CI job — ziextract cannot unpack a .whl, and the linked symlink
returns 'exec format error' when run.

Replace with sigstore/cosign, which still ships static binaries
(cosign-linux-amd64 / cosign-darwin-{amd64,arm64}) and slots into
the alphabetical position between 'checkmake' and 'compress'.
2026-05-30 18:42:00 +02:00
GitHub Actions 74173749a6 docs: generate
Signed-off-by: GitHub Actions <actions@github.com>
2026-05-24 08:12:20 +00:00
Tom Hale 424b241bc7
feat: validate ice arguments (#778)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-24 10:09:43 +02:00
GitHub Actions 6c9ac1c4bc docs: generate
Signed-off-by: GitHub Actions <actions@github.com>
2026-03-24 07:52:22 +00:00
Pedro Pombeiro e88ed77319
fix: remove local -A OPTS that shadows caller's parallel flag (#774) 2026-03-24 08:49:40 +01:00
dependabot[bot] 61a0244bb4
build(deps): bump EndBug/add-and-commit from 9 to 10 (#773)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-23 22:21:42 +01:00
GitHub Actions f40d837148 docs: generate
Signed-off-by: GitHub Actions <actions@github.com>
2026-03-14 22:42:14 +00:00
Andrea Alberti 1334994f20
fix: trust archive permissions instead of file(1) heuristics in ziextract (#771) 2026-03-14 23:39:35 +01:00
dependabot[bot] f82d91ccac
build(deps): bump docker/build-push-action from 6 to 7 (#770)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-07 09:55:12 +01:00
GitHub Actions 4b4845c3b0 docs: generate
Signed-off-by: GitHub Actions <actions@github.com>
2026-03-06 00:29:07 +00:00
Andrea Alberti 807590f25e
Merge pull request #761 from alberti42/fix-extract
- Fix incorrect double extraction when `extract` ice is used with `from'gh-r'`
- Improved documentation of `extract` ice
- Added test units for `extract` ice
2026-03-06 01:26:23 +01:00
Andrea Alberti b4728b29f7
test: added tests for ice extract 2026-03-06 01:15:30 +01:00
Andrea Alberti 4205b399dd
docs: improve documentation of extract modifiers (their documentation was so far completely missing) 2026-03-06 01:15:30 +01:00
Andrea Alberti 4fd38b34e7
fix: prevent double extraction when exclamation mark modifier is used in extract'!'
When using extract'!' with from'gh-r', ziextract was called twice:
1. First by the gh-r download code (line 407) — extracting the archive directly
2. Then by the ∞zinit-extract-hook — calling ziextract --auto --move

On the second call, the .tar.gz was already gone, so --auto mode fell through to file-command detection, which identified .jar files as zip archives
and tried to extract them — corrupting the plugin and producing errors.

Fix: Both the gh-r download path (line 407) and the tarball path (line 272) now skip their direct ziextract call when the extract ice is set,
deferring entirely to the ∞zinit-extract-hook which handles it correctly.
2026-03-06 01:15:30 +01:00