Conversation
Deploying src with
|
| Latest commit: |
b36e84e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://52bb24f3.zi-src.pages.dev |
| Branch Preview URL: | https://bug-203.zi-src.pages.dev |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Startup isolation, path rewriting, branch validation, and integration detection still have correctness issues.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (5)
What changed in this PR
Improves installer safety, rerun idempotency, and non-interactive annex setup.
Changes:
- Replaces destructive updates with fast-forward-only Git operations.
- Improves
.zshrcintegration detection and annex handling. - Adds installer regression tests and updates checksums.
| File | Description |
|---|---|
public/sh/install.sh |
Implements safer updates and profile integration. |
tests/installers.sh |
Adds regression coverage for updated behavior. |
public/checksum.txt |
Updates the installer checksum. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…t .zshrc integration Update path (#203): fetch the requested branch and merge --ff-only, the same operation as `zi self-update`; refuse with the checkout state when a fast-forward is impossible. `git clean -d -f -f` and `git reset --hard` are gone, so local state in the checkout is never discarded. .zshrc probe (#205): detect an existing integration by a real source line instead of any mention of the file names, so a comment cannot suppress the integration; keep the result separate from `-i skip`. The annex and zunit profiles skip when `-i skip` was given or when .zshrc already loads z-shell/z-a-meta-plugins, so a rerun no longer appends a second block. The .zshrc text keeps using $HOME while the installer itself keeps the real path, which also repairs the closing `git log` that ran outside the checkout. Annex burst (#204): run the just-written fragment in `zsh -c` after sourcing zi.zsh, never an interactive shell that executes the user's startup files; a failure prints that annexes install on the next shell start instead of aborting after .zshrc was modified. Harness: the git double logs calls, accepts fetch and merge, fails clean, reset, and pull loudly, and can simulate a non-fast-forward; a zsh double refuses any interactive flag. Five new cases cover the update path, the refusal, the comment probe, the annex rerun, and -i skip. Closes #203 Closes #204 Closes #205
… not read as grep options Also keep ShellCheck quiet on the literal $HOME text with the disable comment the file already uses for that pattern.
This was referenced Sep 19, 2026
Deliver a zi-install skill for AI coding agents, alongside the code-review skill
z-shell/.github#636
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
git clean -d -f -fandgit reset --hard HEADare gone. The existing checkout is updated the wayzi self-updatedoes it:git fetch origin refs/heads/<branch>thengit merge --ff-only FETCH_HEAD. When a fast-forward is impossible the installer refuses, printsgit status --short --branch, and says what to do; local state is never discarded..zshrcprobe and rerun. An existing integration is detected by a realsourceor.line, so a comment that mentionsinit.zshno longer suppresses the integration block. The probe result is kept separate from-i skip. The annex and zunit profiles skip when-i skipwas given or when.zshrcalready loadsz-shell/z-a-meta-plugins, so a rerun appends nothing. The.zshrctext keeps using$HOMEwhile the installer keeps the real path, which also repairs the closinggit logthat ran outside the checkout after the path had been rewritten.zsh -cafter sourcingzi.zsh, never in an interactive shell that executes the user's startup files. A failure prints that the annexes install on the next shell start instead of aborting after.zshrcwas modified.Behaviour changes worth knowing:
-bnow names a branch (refs/heads/), and-i skip -a annexno longer writes the annex block, since-i skipmeans "do not touch.zshrc".Closes #203
Closes #204
Closes #205
Verification
sh ./tests/installers.sh: 27 cases pass, 5 of them new (fetch and fast-forward without clean or reset, non-fast-forward refusal with the checkout state, comment probe, annex rerun idempotency with a non-interactive burst,-i skipwith an annex profile). The git double now logs calls, acceptsfetchandmerge, failsclean,reset, andpullloudly, and can simulate a non-fast-forward; azshdouble refuses any interactive flag.zsh -icmakes the annex case fail (expected one annex burst, sawempty), so the test checks what it claims.shellcheck -s shclean on both files;public/checksum.txtregenerated after the commit hook reformattedinstall.sh.Finding outside this change
check-linux.ymlandcheck-macos.ymlrun the real installer assh -x ./public/sh/install.sh -- -i skip,-- -a annex, and-- -a loader. POSIXgetoptsstops at--, so every flag becomes an operand and all three steps have always run the default profile: the annex and loader paths have never been exercised by those steps. Not changed here; proposed as a separate issue.Agent handoff
No handoff needed.