The real problem that I want to solve is deployment of vim plugins via ansible. The problem is that some plugins have a lot of submodules and it takes a long time to download them and then they use space without any good reason on a hard drive.
The user of the plugin need only one version of it and all of it's submodules, not the whole history tree, right? So why don't download and store only that?
So what do we have to do that? I know that there is a git clone --depth 1 --single-branch
. This works for the plugin, alright, but not for the submodules.
Okay, what do we know about submodules. We have git submodule init --recursive --depth 1, but that doesn't work for submodules that don't track the plugin.
Okay, so I've read this and this
And the second one is saying that I can fetch only specific commit. So can I somehow know what commits for each submodule is plugin want and then use if to download submodules? I don't mind to do it manually somehow without using the submodule command.
The next question is about updating plugins. When we update via git pull we would have more than one commit in our local copy of plugin (and submodules probably). Which is unnecessary. So I thought about instead of doing git pull just delete the plugin altogether and download it again, but maybe there is a better way? In other words is there a way to store only one commit in plugin always?
PS Of course I can just wait for a little longer and it's actually not a big deal that plugins would take more space in hard drive for me. It's mostly curiosity and striving for perfection for me.