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_DIR to unmess git calls. Fix #807. #808

Open
wants to merge 36 commits into
base: next
Choose a base branch
from

Conversation

shippy
Copy link

@shippy shippy commented Apr 12, 2017

Vundle manipulates plugin folders by cd-ing into them and calling git via call system(cmd). This doesn't work if GIT_DIR is set as a global environmental variable (most commonly by a git hook). Since there is no use case in which Vundle should respect GIT_DIR, this PR preemptively precedes all git calls with unset GIT_DIR; . This makes the git calls behave as expected without unsetting GIT_DIR in the environment beyond vim.

See #807 for the kinds of problems that happen otherwise.

Vundle manipulates plugin folders by `cd`-ing into them and calling git
via `call system(cmd)`. This doesn't work if GIT_DIR is set as a global
environmental variable (most commonly by a git hook). Since there is no
use case in which Vundle should respect GIT_DIR, this PR preemptively
precedes all git calls with `unset GIT_DIR; `. This makes the git calls
behave as expected without unsetting GIT_DIR in the environment beyond
vim.
@shippy
Copy link
Author

shippy commented Apr 13, 2017

Notes:

  1. This is inelegant, but I think it gets the job done.
  2. This meets my criteria for a bugfix, but since it's just me and one other guy running into this issue, I'm guessing it can wait until the next next merge.
  3. I wasn't sure how to run the test - though admittedly, I didn't click through all the links on Setup testing environment  #619 - so I just added a line to the vimrc that should break master but not this. That said, I didn't run the test.

gmarik and others added 28 commits April 13, 2017 02:07
The command `silent pedit ...` was causing trouble if the user had `set
hidden`.  Now we `bdelete` the changelog buffer before editing it anew.
The variable is script local to autoload/vundle/scripts.vim since VundleVim#468.
These variables only occur in one file each.  By making them script local
variables this is "documented" in the code.  At the same time the global
namespace is polluted less.

Changed:
    g:bundle_names          -> s:bundle_names
    g:vundle_last_status    -> s:last_status
    g:vundle_log_file       -> s:log_file
    g:vundle_view           -> s:view
If it was loaded, unload the log buffer before editing it.  Otherwise the
editing command can "hang" if the user has `set hidden`.

This problem was originally discovered with the VundleChangelog command and
the analogous fix was applied in 7d9b10.  See github issue VundleVim#468 for more.
All global variables that are not part of the public API (mentioned in the
documentation) are turned into autoload variables.  This is intended to give
all global variables defined by Vundle.vim a common prefix.  The variable
g:default_git_proto is part of the public API and is therefor not changed.
This is the only exception.

Changed:
   g:bundle_dir            -> vundle#bundle_dir
   g:bundles               -> vundle#bundles
   g:updated_bundles       -> vundle#updated_bundles
   g:vundle_lazy_load      -> vundle#lazy_load
   g:vundle_log            -> vundle#log
Unchanged:
   g:default_git_proto
The setting of the default values for the autoload variables is moved out of
any function.  One reason being that these settings do not depend on the
argument of the function.  The second being that Vim will source the autoload
script if an undefined autoload variable is referenced and the file is
expected to define the variable (see :help autoload).
Plugins' names which contain '../', '$HOME', '%:h:h', '..\', etc.
can be dangerous.
Use a sensible whitelist for plugin names and prevent its expansion.
Saves a 301 redirect and removes a tad bit of confusion when `git
clone`-ing Vundle when installing.
incorrect URL and updated references to ':Bundle' commands to ':Plugin'
commands
This is done based on the simplified Chinese version at commit 232cb92.
Traditional Chinese is used by people in Taiwan, Hong Kong and Macao.
They are added by Notepad on M$ Windows.
A traditional Chinese version of the updated `README_ZH_CN.md`.
A traditional Chinese version of the updated `README_ZH_CN.md`.
calebeby and others added 7 commits April 13, 2017 02:07
* Updates readme to use github markdown checkmarks
According to this discussion VundleVim#713 this plugin is simply an example, but the example seems to consistently break the installation process.

If this is the case better to remove it.

Another example of it causing problems: VundleVim#784
shell=/bin/bash needs to start with `set` in order to actually make vim+fish work correctly.
@shippy
Copy link
Author

shippy commented Apr 24, 2017

...nevermind, not ready to merge - this breaks Vundle on Windows, as there's no unset command available on a plain git + curl installation.

@ryanoasis
Copy link
Member

@shippy Thanks for this information it is valuable and appreciated 😄

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.