airblade / voom

A simplest-thing-that-works Vim plugin manager. Use with Vim 8 or Pathogen.
MIT License
29 stars 9 forks source link

Fails to update any GitHub-based plugin whose default branch is not master #14

Closed airblade closed 7 years ago

airblade commented 7 years ago

I noticed this with arcticicestudio/nord-vim. It looks like the repo's default branch is develop; that's what was checked out in my local copy of the repo once voom had installed it.

This causes the following line in the update_plugin() function to fail: https://github.com/airblade/voom/blob/b94bd18c9e89fc627013034068d5c2652c7d9cce/voom#L87

The failure is:

fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

The remote repo has a master branch but the local repo doesn't.

airblade commented 7 years ago

Possible solutions:

airblade commented 7 years ago

First option gives the user control and is the best option.

Second option is a good default for now...and the least work ;)

Third option is not ideal.

Rycieos commented 7 years ago

This issue brings up another one.

If the default branch is develop, but the user wants to instead use the more stable master branch, they have no way to specify that.

With your change, if the user runs git checkout master after voom installs the repo, voom should keep it up to date on the master branch. This solves the issue, but requires manual work.

airblade commented 7 years ago

I agree, there's no way to specify the branch the user wants (but there wasn't before).

This change is the second best option: voom uses the upstream repo's default branch; but if you manually check out another one, it'll use that.

airblade commented 7 years ago

Ideally we'd add the ability for a user to specify a branch too (so far I haven't needed it).