Shougo / dein.vim

:zap: Dark powered Vim/Neovim plugin manager
MIT License
3.43k stars 198 forks source link

`main` `master` Fallback Method #399

Closed bravecorvus closed 3 years ago

bravecorvus commented 3 years ago

So the way the world of open source git services are going, most projects will use main in place of master in the next few years.

In the meantime, tools like dein that rely on git pull origin master will start to break for more and more projects:

Take the following for example:

img1 img2 img3

My guess is that this project used to use master, but switched to main in preparation for the new world order.

I think dein.vim will need to remain compatible with both until git repos reach a state where all repos use main branches (which may take years, or never happen unless forced upon repo maintainers by service providers like Github).

I propose that in the meantime, dein.vim should support a fall back method as follows:

Check if git pull origin master works. If it does not work, delete the entire repository, clone from scratch, and use git pull origin main from that point forward for that specific repository.

There might be better approaches to this, but the underlying problem of remote branch names going from master to main remains constant.

あるいはShougoさんがもう何かの案を検討している場合には無視してください。よろしくお願いします。

Shougo commented 3 years ago

It is SpaceVim's dein.vim is too old problem. Please see the timestamp.

https://github.com/SpaceVim/SpaceVim/blob/e09a8e473502b1d6d528e5548195e2c4634918a9/bundle/dein.vim/autoload/dein/types/git.vim

It is already fixed in dein.vim HEAD.

It should be reported to SpaceVim maintainer.

Shougo commented 3 years ago

Check if git pull origin master works. If it does not work, delete the entire repository, clone from scratch, and use git pull origin main from that point forward for that specific repository.

It is very dangerous approach. I cannot use it.

bravecorvus commented 3 years ago

Okay thanks.