Repository navigation
fix(merge): fold specs deriving the same plugin name (#39) - #40
Merged
Merged
Conversation
zuqini
force-pushed
the
mason-src-conflict-39
branch
4 times, most recently
from
September 21, 2026 23:16
f8e3690 to
f416f56
Compare
Two specs that derive the same name from different owners (e.g.
`williamboman/mason.nvim` in a dependencies list and
`mason-org/mason.nvim` at top level) survived import as separate registry
entries and vim.pack.add aborted setup() with a conflicting-src error.
Group registry entries by the name their merged spec resolves to — the
exact name handed to vim.pack — and fold each group into one entry. The
same-`[1]` override case is a subset, so this replaces the shorthand
special case rather than adding a second pass. Keying on the entry's
resolved name (not on every `[1]` or basename a fragment carries) keeps
the fold set equal to the conflict set: a `{ 'user/repo', name = 'alias' }`
entry no longer swallows an unrelated `other/repo`, and a `[1]`-less
fragment of a fork no longer lends the fork's basename to the fold. Since
every entry resolves to exactly one name, a single pass suffices. The
chained-`[1]` fixpoint fold is dropped with it: lazy.nvim keeps `a` and
`b` as two plugins for that shape, so converging them was itself
non-parity (fragment identity on a src-keyed registry is zpack_nvim-3wn).
Entries rank as a (tier, import order) pair: an explicit src/url/dir
fragment beats a bare top-level one, which beats a dependency-only one;
the latest-imported wins within a tier. lazy.nvim is pure
later-fragment-wins; the tiers are a deliberate divergence so the winner
does not depend on plugin-file import order. A fold that joins entries
naming no repo in common — a shared `[1]`, or a src/url equal to the
other's `[1]` — emits one WARN naming both sources and the winner.
`name` on one fragment keeps it apart from same-`[1]` fragments, as in
lazy.nvim. Folded fragments merge fields as usual, so `enabled = false`
on either owner disables the plugin.
Document the fold and its precedence under `name`.
Closes #39
zuqini
force-pushed
the
mason-src-conflict-39
branch
from
September 21, 2026 23:40
f416f56 to
c14ee9f
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.
vim.pack.addaborts withConflicting `src`when two specs in one call derive the same plugin name from different URLs. zpack keyed the spec registry by normalized source, so a config referencing a plugin under both its old and new GitHub owner — e.g.mason-org/mason.nvimat top level andwilliamboman/mason.nvimin another plugin'sdependencies— produced twomason.nvimentries and a hardsetup()failure. lazy.nvim keys plugins by derived name and silently lets the last fragment's URL win, so the same config worked there.[1]shorthand URL, replacing the shorthand special case. Same-[1]override folds behave as before; folds that join entries naming no repo in common (a shared[1], or asrc/urlequal to the other's[1]) emit one WARN naming both sources and the winner.src/url/dir> top-level spec > dependency-only spec, latest import within a tier;devprecedence unchanged.name = '...'still keeps deliberately distinct plugins apart.nameescape hatch, and no-warn on fork overrides; docs note undername.Behavior change to be aware of:
{ 'user/repo', name = 'x', url = fork }+{ 'user/repo', keys = ... }previously folded into one plugin; they now resolve toxandrepoand stay separate, as in lazy.nvim (wherenameis the plugin's identity). No user report depends on the old behavior; the docs undernamedescribe the new one.Closes #39
Implements bead
zpack_nvim-3wn(close on merge).