Closed jolan78 closed 12 years ago
Excerpts from jolan78's message of Tue Sep 13 14:52:21 +0200 2011:
hello. here is a patch which disable git's shallow clones if git is too old (shallow clone was added in 1.5.0) the code may not follow your coding standards , feel free to rework it.
Looks fine to me in general.
However I'd prefer less code. What about let git_provides_depth = system('git clone --help') =~ '--depth' ?
Don't think we really need version comparison yet.
What happens if there is no git?
Marc Weber
sure, git clone --help would be fine. I didn't think about the absence of git. then : let git_provides_depth = executable('git') && system('git clone --help') =~ '--depth' would be do the trick
please test b346438. Thanks for this improvement
it works great. thank you.
hello. here is a patch which disable git's shallow clones if git is too old (shallow clone was added in 1.5.0) the code may not follow your coding standards , feel free to rework it.
From 0f8c1f27d352077de807acdd266df21e01295065 Mon Sep 17 00:00:00 2001 From: jolan78 spam00fr@yahoo.fr Date: Tue, 13 Sep 2011 14:45:08 +0200 Subject: [PATCH] git version detection for shallow repos
autoload/vcs_checkouts.vim | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/autoload/vcs_checkouts.vim b/autoload/vcs_checkouts.vim index 61930c6..41c1552 100644 --- a/autoload/vcs_checkouts.vim +++ b/autoload/vcs_checkouts.vim @@ -2,7 +2,25 @@ " its very short probably VAM will keep a copy
exec vam#DefineAndBind('s:c','g:vim_addon_manager','{}') -let s:c.shallow_clones = get(s:c,'shallow_clones',1) + +fun! vcs_checkouts#IsGitVersionGT(minrev)
return 1 +endfunction + +let s:c.shallow_clones = get(s:c,'shallow_clones',vcs_checkouts#IsGitVersionGT([1,5,0])) let s:c.scm_extra_args = get(s:c,'scm_extra_args',{})
let s:se = s:c.scm_extra_args
1.4.4.4