Skip to content
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

Treat changed remotes as new plugins (II) #440

Merged
merged 2 commits into from
Apr 15, 2014
Merged

Treat changed remotes as new plugins (II) #440

merged 2 commits into from
Apr 15, 2014

Conversation

jdevera
Copy link
Contributor

@jdevera jdevera commented Apr 15, 2014

What this PR is

This my counter proposal to @Uroc327's PR #400
Fixes #367 #48 #183

Based on @aaronjensen's suggestion to use git fetch && git reset --hard origin/HEAD instead of pull, but with an important distinction: Do it only when the URI in the Vundle config is different to that of the origin remote in the existing repository.

This, in effect, wipes out the old repo and checks out the contents of the new.

As a follow up, we should probably warn the user when they have clashing names in their config, as only the latest one will be valid.

From the commit message

If one had this plugin:

Plugin 'foo/bar'

And now switches to another one with the same name:

Plugin 'baz/bar'

Recognise this scenario and replace the old plugin with the new one,
rather than silently assuming they are the same.

How I tested it

I created a dummy repo:

mkdir /tmp/Align
cd /tmp/Align
git init .
echo "foo" > foo
git add foo
git ci -m foo

The I added these two lines to my vimrc:

Plugin 'file:///tmp/Align'
Plugin 'Align'

I restarted Vim and ran :VundleInstall (no need for !). I verified that both plugins got a + on the installer, that the log mentioned the remote change, and that I could use the Align command afterwards.

@jdevera
Copy link
Contributor Author

jdevera commented Apr 15, 2014

I created this other one because since we are merging to next, the other pull request #425 was showing all commits in that branch.

@jdevera
Copy link
Contributor Author

jdevera commented Apr 15, 2014

@starcraftman @gmarik merging to next later today if there are no objections.

If one had this plugin:

Plugin 'foo/bar'

And now switches to another one with the same name:

Plugin 'baz/bar'

Recognise this scenario and replace the old plugin with the new one,
rather than silently assuming they are the same.

Fixes #367 #48 #183 #400
@jdevera jdevera merged commit 3c6dd6d into next Apr 15, 2014
@jdevera jdevera deleted the bug/changed_urls branch April 15, 2014 15:12
@jdevera
Copy link
Contributor Author

jdevera commented Apr 15, 2014

Merged into next

@aaronjensen
Copy link

awesome! so what's the timeframe on merging next in?

@jdevera
Copy link
Contributor Author

jdevera commented Apr 15, 2014

@aaronjensen we have to give it a good spin, so the more the merrier. If you can test it too, that'd be great. All you have to do is cd into your .vim/bundles/vundle and do a git checkout next. Vundle should take it from there.

@aaronjensen
Copy link

Tried it out, I get errors on PluginInstall!: #441

@jdevera
Copy link
Contributor Author

jdevera commented Apr 15, 2014

@aaronjensen hopefully that is fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants