lambdalisue / vim-gina

👣 Asynchronously control git repositories in Neovim/Vim 8
http://www.vim.org/scripts/script.php?script_id=5531
MIT License
689 stars 27 forks source link

Handle GIT_DIR environment variable #255

Open jwhitley opened 4 years ago

jwhitley commented 4 years ago

Please reconsider support for $GIT_DIR in gina.vim. Concrete use case:

The vcsh tool for versioning $HOME is designed to overlay several managed git repositories on the user's home directory. It works very well. Example:

> echo $GIT_DIR
# nothing
> vcsh vim
# now in a subshell with $GIT_DIR set
> echo $GIT_DIR
/Users/foo/.config/vcsh/repo.d/vim.git
> git status
# ... status of vim repo ...

Only $GIT_DIR is set by vcsh. There are some similar tools that also use $GIT_DIR to manage this style of work.

Related to #130. IMO, I feel like the prior issue overcomplicated things. Fugitive, for example, does handle $GIT_DIR and $GIT_WORK_TREE, but not $GIT_COMMON_DIR. I'm not aware of any user tooling that uses $GIT_COMMON_DIR. I attempted to search GitHub looking for examples, but found only git scripting and git-* tools (outside of git forks).

lambdalisue commented 4 years ago

I got. Well now I think it's worth but I'm not using such tools thus I don't have enough motivation to implement it by myself. PRs are welcome 👍

You may need to change code in https://github.com/lambdalisue/gina.vim/blob/master/autoload/vital/__gina__/Git.vim#L17-L66

jwhitley commented 4 years ago

Thanks! I’ll have a look. 👀