Pointing lazy.nvim to a Pull Request

Featured image for sharing metadata for article

As I did an update earlier on my Neovim plugins, I noticed a breaking change from codecompanion.nvim hadn't yet been addressed upstream with mcphub.nvim, but fortunately a couple of options were contributed by the community.

Until the PRs are merged, I wanted a way to pull the changes into my local setup with lazy.nvim, so I could continue using MCPHub.

As I'd posted about on one of the PRs, we can take advantage of using the Git refs for PRs, and then tell Lazy to use that branch.

This allows you to specify - as a one-time thing - the ref fetching for the given plugin:

git config remote.origin.fetch '+refs/pull/*:refs/remotes/origin/pull/*'

Then from here, you can tell Lazy to use that PR branch:

return {
  "ravitemer/mcphub.nvim",
  branch = "pull/279/merge"
}

(Note that you want to use pull/279/merge so it doesn't break when the PR is merged - or maybe you do want that, and instead want to use pull/279/head, for the forked repo's head branch)

Written by Jamie Tanna's profile image Jamie Tanna on , and last updated on .

Content for this article is shared under the terms of the Creative Commons Attribution Non Commercial Share Alike 4.0 International, and code is shared under the Apache License 2.0.

#blogumentation #neovim.

This post was filed under articles.

Interactions with this post

Interactions with this post

Below you can find the interactions that this page has had using WebMention.

Have you written a response to this post? Let me know the URL:

Do you not have a website set up with WebMention capabilities? You can use Comment Parade.