-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clone branch pointed by origin/HEAD instead of 'master' by default #288
Comments
@ABorgna Isn't that a catch 22 though? We are - during PlugInstall - directly cloning the exact branch requested (master by default) at IMO rdnetto should just have a master branch, like literally every other plugin I've ever installed or seen. Seems silly breaking such a convention for no strong reason I can see. I'd go make a ticket on his plugin regarding that. |
I agree this is not a common issue, but |
This was discussed before (#257 (comment)), and I still think it's better to be explicit. Without explicit branch specification, vim-plug has no way to verify if the local clone is in valid state and I believe it's simply better to know in the first place that you're using a non-master branch considering that the author of the plugin can change the default branch at any time. Most importantly, I've never had to use a plugin that does not use master branch and I don't want to complicate things (code-wise) for such exceptional cases. I'm going to close the issue as |
I'm aware that this issue has been closed now, but I thought I'd post anyway to explain why my plugin lacks a master branch. (I kinda wish you'd @mentioned me so I could have done so earlier.) YCM-Generator originally had a master branch, and then later had a stable branch created. However, this resulted in many people cloning the master branch and either getting a bad impression of the project, or filing issues regarding it. (It's a development branch, it's going to be broken sometimes.) Consequently I renamed that branch to develop and made stable the default branch, to ensure that people either migrated to stable or made a conscious decision to use master. The naming of the branches was based on the git flow model, except that I did not name my production ready branch master since I thought that would cause confusion. The reality is that the meaning and existence of the master branch varies from project to project, and relying purely on convention results in bad defaults, especially since At any rate, I just merged a PR to document this in YCM-Gen, so there's a workaround in place now (for my project anyway). |
@rdnetto Hi. Well I think @junegunn made his opinion clear, so we aren't likely to revisit this. I find your explanation a bit odd. It seems like it would have been a lot less effort/confusion if you had just stabilized master branch to be your production code, then made develop branch as your dev line. Just my opinion though. |
@rdnetto I see your point. But this (allegedly false) assumption makes the code of vim-plug simpler and easier to maintain. It works 99.9% of the time, and it's not like we don't have a way around. Let's say that vim-plug requires you to be explicit about the branch to use and |
@starcraftman That's fair enough - I just wanted to explain the opposing viewpoint, especially since I think it's only a matter of time until this comes up again. @junegunn I don't doubt it - I thought about how you'd go about implementing the correct behaviour and it is much more painful. It's not the choice I'd make myself, but then it's not my project either. At any rate, YCM-Gen's README includes a note about the correct line for vim-plug, so it's a moot point now. |
See also junegunn/vim-plug#288 which was marked wontfix
According junegunn/vim-plug#288 (comment) we have to precise the branch to clone if different of "master" in despite the fact that the "next" branch is set by default: > `Plug 'something'` is simply a shorthand notation of `Plug 'something', { 'branch': 'master' }` I was trying many times to install LanguageClient-neovim from scratch and invariably the master branch was cloned.
According junegunn/vim-plug#288 (comment) we have to precise the branch to clone if different of "master" in despite the fact that the "next" branch is set by default: > `Plug 'something'` is simply a shorthand notation of `Plug 'something', { 'branch': 'master' }` I was trying many times to install LanguageClient-neovim from scratch and invariably the master branch was cloned.
Installing a plugin from github without specifying a branch makes vim-plug try to clone the 'master' branch.
But the repository's default branch can be changed, and the installation fails if 'master' doesn't exist.
Steps to reproduce
master
branch in it's repo to.vimrc
.Plug 'rdnetto/YCM-Generator'
:PlugInstall
.Output
Explicitly setting the
branch
option in the plugin line solves the issue, but I think we should use the default branch (which is pointed by the origin's HEAD) if none specified.The text was updated successfully, but these errors were encountered: