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

Unset GIT_CONFIG during git config #858

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Unset GIT_CONFIG during git config #858

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jul 14, 2019

Fixes #470, #834
Related #455, #471

GIT_CONFIG only affects git config as documented here. Why don't we just unset it, so that :PlugUpdate works properly whether plugins are installed by vim-plug or git submodule.

Plugins fail to update when managed with `git submodule`. Unset
`GIT_CONFIG` so that `git` take the configuration in default behavior.

Close #455
Close #470
Close #834
@ghost ghost changed the title remove -f .git/config from git config Unset GIT_CONFIG during git config Jul 22, 2019
@@ -1625,7 +1625,7 @@ class Plugin(object):
self.write(Action.DONE, self.name, result[-1:])

def repo_uri(self):
cmd = 'git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url'
cmd = 'git rev-parse --abbrev-ref HEAD 2>&1 && unset GIT_CONFIG && git config remote.origin.url'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the unset be done before the first git rev-parse, I wonder? Could an errant GIT_CONFIG somehow change how --abbrev-ref determines the branch name?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re my comment, if that's the case, note that that would be an existing bug rather than a problem introduced by this PR. I think this PR could be merged as is.

@@ -2054,7 +2054,7 @@ endfunction
function! s:git_validate(spec, check_branch)
let err = ''
if isdirectory(a:spec.dir)
let result = s:lines(s:system('git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url', a:spec.dir))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this meant to work on all OS?

@Curry2323
Copy link

Yygtt

@Curry2323
Copy link

Conflicting files plug.vim

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.

Misleading errors about vim-plug on :PlugUpdate
3 participants