[X] I have searched the existing issues of lazy.nvim
[X] I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
0.10.0
Operating system/version
Linux and MacOS
Describe the bug
I'm committing my lazy-lock.json file to my dotfiles git to ensure all my computers use the same version of all plugins for which my config is tweaked and tested.
To ensure consistency, I'm using the R option in the Lazy Menu to ensure it restores the same plugin versions after pulling the latest changes from my other computer.
However, after pulling the changes and pressing R in the Lazy Menu to restore the plugins, I can see changes in my lazy-lock.json file that make no sense.
As you can see, lsp-zero.nvim package is still on the same commit it was on my other computer (which is OK and expected), but the branch name has changed. Apparently, both main and v3.x branches currently point to the same commit in the lsp-zero.nvim repository. This confuses the lazy.nvim to randomly choose the branch pointing to the commit.
This not only causes annoying diffs on my different computers, but also introduces a small risk of having different update behavior on different computers - I'm guessing that lazy.nvim uses the branch name to check for updates in that branch, and if for some plugin those branches diverge, different computer using the same lockfile in the same time can observe different updates for the same plugin, assuming that the diff in question wasn't reverted or committed.
Can this be made consistent?
Steps To Reproduce
Install some plugin that has multiple branches pointing to the same comit.
Move the lazy-lock.json to a different computer
Restore the plugins from migrated lockfile on a different computer
Expected Behavior
Restoring the plugins should never modify the lazy-lock.json
Actual Behavior
Sometimes the file is changed in an unexplained way.
Did you check docs and existing issues?
Neovim version (nvim -v)
0.10.0
Operating system/version
Linux and MacOS
Describe the bug
I'm committing my
lazy-lock.json
file to my dotfiles git to ensure all my computers use the same version of all plugins for which my config is tweaked and tested.To ensure consistency, I'm using the
R
option in the Lazy Menu to ensure it restores the same plugin versions after pulling the latest changes from my other computer.However, after pulling the changes and pressing
R
in the Lazy Menu to restore the plugins, I can see changes in mylazy-lock.json
file that make no sense.Here is an example of the diff:
As you can see,
lsp-zero.nvim
package is still on the same commit it was on my other computer (which is OK and expected), but the branch name has changed. Apparently, bothmain
andv3.x
branches currently point to the same commit in thelsp-zero.nvim
repository. This confuses thelazy.nvim
to randomly choose the branch pointing to the commit.This not only causes annoying diffs on my different computers, but also introduces a small risk of having different update behavior on different computers - I'm guessing that
lazy.nvim
uses thebranch
name to check for updates in that branch, and if for some plugin those branches diverge, different computer using the same lockfile in the same time can observe different updates for the same plugin, assuming that the diff in question wasn't reverted or committed.Can this be made consistent?
Steps To Reproduce
lazy-lock.json
to a different computerExpected Behavior
Restoring the plugins should never modify the
lazy-lock.json
Actual Behavior
Sometimes the file is changed in an unexplained way.