-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
Errors when updating repos with branch named "main" instead of "master" #86
Comments
So, you can work around this by using Do you think it would be helpful to provide a new setting for the default "default branch name"? Other than that, I'm not sure there's a way to get around specifying the branch name plugin-by-plugin. |
Why not make the inclusion of a specific branch (ref, etc) on the clone command conditional based on whether or not a branch is provided? If there's not a specified branch, don't clone a specific branch. I'm looking through vim-plug and that seems to be the approach there. There are probably some side effects in terms of how updates would need to work, but this seems like the more future-proof approach. Especially considering the rising adoption of |
.. to account for wbthomason/packer.nvim#86 Fixes #6
@timbedard Ok, that seems like a reasonable solution. The trick will be in detecting what to check out if a plugin spec changes branches, e.g. if a user initially specifies It looks like |
@sunjon and others: this should be fixed now, but please let me know if you still encounter errors (or encounter new errors this change may have introduced). Thanks! |
@wbthomason Nicely (and quickly) done! Working great. Thanks! |
.. to account for wbthomason/packer.nvim#86 Fixes #6
getting this issue with https://github.com/kdheepak/lazygit.nvim
They may have changed from 'master' -> 'main'? I'm happy to use |
By default packer tries to use "master" for the branch of any plugin that doesn't have a branch explicitly defined. However, the bufferline authors recently renamed their default branch from "master" to main. Thus, packer will work fine with bufferline for any new clones, but it will fail to update for anyone who had the old branch name "master" set. See also: wbthomason/packer.nvim#86
I just had the same problem. I never specified a branch explicitly in my configuration; but the authors of bufferline.nvim seem to have deleted master/renamed the master branch to main. See: NvChad/NvChad#940 @wbthomason I might suggest that when no branch is explicitly defined and there's an error related to a non-existent remote branch, Packer should fall back to the remote head. Unfortunately I'm not skilled in lua, but this is how you could get that information from the commandline: ❯ git remote show origin | grep HEAD | sed 's/^.*: \(.*$\)/\1/' example: ❯ cd /tmp
❯ git clone https://github.com/akinsho/bufferline.nvim
❯ cd bufferline.nvim/
❯ git remote show origin | grep HEAD | sed 's/^.*: \(.*$\)/\1/'
main It's also probably worth noting: I don't expect this problem to go away. There are still a lot of repos around with the remote head set to "master". Whether or not folks buy into "'master' is a non-inclusive name and we should stop using it", as "main" becomes the de facto standard due to "main" being default on all major hosting platform, I expect more and more folks changing branch names at least to avoid annoying errors from "main" vs "master" muscle memory. See also: |
By default packer tries to use "master" for the branch of any plugin that doesn't have a branch explicitly defined. However, the bufferline authors recently renamed their default branch from "master" to main. Thus, packer will work fine with bufferline for any new clones, but it will fail to update for anyone who had the old branch name "master" set. See also: wbthomason/packer.nvim#86
By default packer tries to use "master" for the branch of any plugin that doesn't have a branch explicitly defined. However, the bufferline authors recently renamed their default branch from "master" to main. Thus, packer will work fine with bufferline for any new clones, but it will fail to update for anyone who had the old branch name "master" set. See also: wbthomason/packer.nvim#86
Github allows users to change the default branch name from master. Packer doesn't currently support
main
as a branch name:The text was updated successfully, but these errors were encountered: