Don't flag name duplication when installing the same plugin twice#586
Don't flag name duplication when installing the same plugin twice#586
Conversation
autoload/vundle/installer.vim
Outdated
There was a problem hiding this comment.
Vimscript, not shellscript ;)
|
Like you mentioned in #509:
You can also have the same plugin with the same name but different URIs (e.g. Original Github repo vs. vim-script). Do you want to take this into account as well? Currently taking it for a test drive. I will comment afterwards. |
|
Seems to work well except for a couple of problems. I'm not sure if it's best to try handling name collisions for a single case of same name and same URI, and fail for the rest of the cases, or echoing an instructive message which asks the user to recheck the installed plugins. This can be done with a combination of |
|
Wow! that For the URL topic. I consider different URLs to be different plugins even when they conceptually are the same plugin. Since updates will be different and it will bring nasty surprises soon. You raise a very good point with the remote change. This needs to be addressed for sure. I'll try to do that in the same push. I'm thinking of splitting name check and registration into two steps, with the name check first, and only if that passes, then we do the git operation, and after that the name registration. This way if we find it to be a duplicate we will not have changed anything in the repository. I'll look into the lesss frightening options for showing messages too. All in all, thank you very much @Av3r4ge for this thorough review. |
|
Glad to help. Everyone has their W.T.F bugs, it's part of the fun.
Very well then. In that case this PR is great. |
Name duplication is checked so that users don't end up overwriting one plugin directory with the contents from another plugin that shares a common name. However, if the repeated plugin happens to be the same, there will be no surprises and there is no need to flag this as an error. This needs if particularly acute due to the fact that we currently don't show, in the plugin search, which of the resulting plugins are already installed, so a user might very well attempt to install a plugin they already have. With this change, instead of seeing an error in this scenario, the user will see a message indicating the plugin is already installed, and no additional cloning will be performed. Fixes #509
When Running PluginInstall or PluginUpdate with a list of plugins and some of those have failed name validation, they are returned as empty dictionaries. Exclude those before checking the size of the list so that if all given plugin names failed, then the empty list message is shown.
If then plugin name check fails during the servicing of a interactive install request, the operation should leave no traces. Before this change, git cloning or resetting of the origin remote occurred before checking the name. This change reverses that.
* Lower the severity of some of the errors when they are not really catastrophic. * Mention Vundle in all messages * Make some of the messages a little more specific Closes #579
|
Ok, I made so that the unmentionable mistake never happened :P I also reversed the order of operations when installing interactively so that errors with name will exit early and not cause the remote change you experimented. Also made errors be warnings when they were more clearly user caused, and they did become less scary when used |
|
Looks great! The remote doesn't change and I don't get a scary error on conflict.
|
|
What do you mean by "when I try to install a conflict"? |
|
Installing a plugin with the same name but with a different URI. |
|
Not sure whether you saw the commit notice (clausreinke@908662e) in the old issue, but to avoid duplicate identical entries I switched |
|
Closing this as I have lost the context here completely. |
Name duplication is checked so that users don't end up overwriting one
plugin directory with the contents from another plugin that shares a
common name.
However, if the repeated plugin happens to be the same, there will be no
surprises and there is no need to flag this as an error. This needs if
particularly acute due to the fact that we currently don't show, in the
plugin search, which of the resulting plugins are already installed, so a
user might very well attempt to install a plugin they already have.
With this change, instead of seeing an error in this scenario, the user
will see a message indicating the plugin is already installed, and no
additional cloning will be performed.