Add branches support to update_plugin.sh#299
Open
illia-shkroba wants to merge 1 commit intotmux-plugins:masterfrom
Open
Add branches support to update_plugin.sh#299illia-shkroba wants to merge 1 commit intotmux-plugins:masterfrom
illia-shkroba wants to merge 1 commit intotmux-plugins:masterfrom
Conversation
fcbf121 to
867951b
Compare
AntoineGS
added a commit
to tmuxpack/tpack
that referenced
this pull request
Feb 16, 2026
Updates now respect the #branch suffix in plugin specs. When a plugin is configured with a specific branch (e.g. user/repo#v2), the update operation checks out that branch before pulling. Previously the branch was only used during initial clone. refs tmux-plugins/tpm#299
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.
Encountered problem
Recently I've encountered an issue with https://github.com/catppuccin/tmux/tree/main plugin. The most recent release was not backwards compatible (major version update), and because of that my config was no longer working, although I was happy with how it had looked like.
The catppuccin plugin was added to my tmux.conf like this:
set-option -g @plugin 'catppuccin/tmux'Since there was no tag specified like
'catppuccin/tmux#v0.3', theupdate_plugins allfetches the most recent version fromorigin/HEAD-- which is to be expected. What I hadn't expected, was that when I had fixed my config by adding the tag:set-option -g @plugin 'catppuccin/tmux#v0.3'restarted
tmux, and runupdate_plugins allagain, thecatppuccin/tmuxrepository still had themainbranch (the one that was configured withorigin/HEAD) checked out. Only when I had removed the plugin entirely and then brought it back with the appropriate version, the problem was solved.When user changes the version in the config it is not used by the
update_plugins. It means that in order to change the version, the user has to remove the plugin entirely and then reinstall it.Cause
The issue was that scripts/update_plugin.sh ignores branches/tags/commits set in the config.
Fix
I have fixed the described issue in this PR. Could you please kindly take a look? Any suggestions and comments are highly appreciated.
I haven't contributed to the
tpmproject yet, so I understand that the changes that I've made might not follow the used coding style (although, I did my best to make sure they do). In case you find the code style to be incompatible, please kindly let me know.Git version
The fix was tested with the following
gitversions:2.43.02.47.0