Repository navigation
fix(utils): only pass git URLs through [1]; flag local paths in validate - #44
Merged
Merged
Conversation
#42 passed `[1]` values starting with `/`, `~`, or `.` through unchanged, but vim.pack hands `src` to `git clone` verbatim: `{ '~/repo' }` fails with "repository '~/repo' does not exist", and `{ './repo' }` resolves against whatever directory nvim was started from. `{ dir = '~/repo' }` already covers local checkouts and is `vim.fn.expand`ed, so `[1]` now passes through only URL-shaped values (any `scheme://` and scp-style `user@host:`); anything else is `owner/repo` shorthand. This is exactly lazy.nvim's rule, which has no local-path branch for `[1]` at all. `/abs` in `[1]` never worked in a released version, so nothing depends on it. Pin the reported bug end to end: a full URL in `[1]` registers under that URL instead of `https://github.com/https://...`. Pin the shorthand outcome for `~`, `./` and `/` with exact assertions instead of `~=`; the old test passed for any transformation, including a future expansion branch.
zuqini
force-pushed
the
zpack-pr42-followup
branch
from
September 25, 2026 19:00
c8e653b to
c32b15b
Compare
`[1]` still read as "always expands to github.com" in the vimdoc, spec.md, and the LuaLS field annotation after #42 made full URLs pass through. State the split at each site: `owner/repo` expands, a full git URL (any `scheme://` or scp-style `user@host:`) is used as-is, and local checkouts go through `dir`. Make `dir` read as the local-checkout field rather than a compat alias, and note on `src` that it is passed to git verbatim, so `~` is not expanded there either. Otherwise a reader scanning the field list sees `src` = "local path, highest priority" and `dir` = "compat shim" and picks the one that does not expand.
Since #42 a `[1]` value may be a full URL and is matched before any concatenation, so the fold_rank and normalize_source comments described a shape that no longer exists.
`{ '~/repo' }` now fails with "https://github.com/~/repo not found",
which is no more actionable than git's old "repository '~/repo' does
not exist". The prefix is trivially detectable, so have validate_spec
say "use dir" up front. Advisory only, like every other spec check.
Flag it only when `[1]` is actually the source: with an explicit
src/url/dir it just feeds the name, so `{ '~/foo', dir = '~/foo' }`
would otherwise warn on every setup() telling the user to do what they
had already done. A `dev = true` spec is skipped too — it loads from
dev.path, and `[1]` reaches git only under `dev.fallback = true` with a
missing checkout, which validate cannot see.
The suggestion does not echo the value: `dir = "./repo"` would resolve
against nvim's start directory, the very hazard that pulled `./` out of
`[1]`.
zuqini
force-pushed
the
zpack-pr42-followup
branch
from
September 25, 2026 19:22
e831f70 to
2504b24
Compare
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.
Follow-ups to #42, which let a full git URL in
[1]pass through instead of being prefixed withhttps://github.com/.#42 also passed
[1]values starting with~,.or/through unchanged, but vim.pack handssrctogit cloneverbatim:{ '~/repo' }fails with "repository '~/repo' does not exist", and{ './repo' }resolves against whatever directory nvim was started from.{ dir = '~/repo' }already covers local checkouts and isvim.fn.expanded, so[1]now passes through only URL-shaped values (anyscheme://and scp-styleuser@host:); anything else is treated asowner/reposhorthand. This is exactly lazy.nvim's rule, which has no local-path branch for[1]at all.Because
{ '~/repo' }would otherwise fail with an equally unhelpful "github.com/~/repo not found",validate_specnow flags a[1]starting with~,.or/with "looks like a local path — use dir". Advisory only, like every other spec check, and only when no explicitsrc/url/diris set — with one of those present[1]just feeds the name and never reaches git. Adev = truespec is skipped too: it loads fromdev.path, and[1]reaches git only underdev.fallback = truewith a missing checkout, which validate cannot see.Also:
[1]registers under that URL, name derives from its basename)~/,./and/in[1]become shorthand[1]/spec block/dependencies note,docs/spec.md, LuaLSzpack.Specannotation):owner/repoexpands to GitHub, a full git URL is used as-is, usedirfor local pathsdirdocs lead as the local-checkout field instead of a compat alias;srcdocs note that it is passed to git verbatim, so~is not expanded there either — usedir[1]is always shorthand; test data usesexample.comhostsRefs #42