el-get icon indicating copy to clipboard operation
el-get copied to clipboard

Consider using shallow clone during install to save time

Open DarwinAwardWinner opened this issue 13 years ago • 11 comments

Cloning all of el-get takes a while. Maybe if doing a shallow clone is significantly faster, we should do that by default in the installer. This would make things friendlier for new users who won't have to wait as long before experimenting with el-get.

DarwinAwardWinner avatar Oct 07 '12 01:10 DarwinAwardWinner

Good idea.

dimitri avatar Oct 07 '12 19:10 dimitri

I just tested it, and it saves a good bit of data.

The drawback is, of course, that the shallow clone option is fairly new, and we can't necessarily count on everyone having an up-to-date version of git, so maybe we should wait a while before doing this (like until shallow clones trickle down into debian stable's git version).

DarwinAwardWinner avatar Oct 07 '12 20:10 DarwinAwardWinner

Is there a way to discover its availability at run time?

dimitri avatar Oct 08 '12 07:10 dimitri

Other than the "duck typing" approach, I don't think so. I guess you could grep the man page or something, but that's fragile.

DarwinAwardWinner avatar Oct 08 '12 09:10 DarwinAwardWinner

Why not just try to checkout the repo with a shallow clone and then check the return value. If it is different from 0 then try it without --depth.

twmr avatar Oct 08 '12 10:10 twmr

That would be the "duck typing" approach.

DarwinAwardWinner avatar Oct 08 '12 16:10 DarwinAwardWinner

How about git --version? But the "duck typing" approach is easier I guess.

tkf avatar Oct 08 '12 16:10 tkf

I'm voting for duck typing. Which is the first git version to include shallow clones?

dimitri avatar Oct 14 '12 19:10 dimitri

According to the git logs (emphasis mine):

[git/git@f4bf2184ae8b79f95b9f56c1ea5455d04e559299] [email protected], 6 years ago: Update clone/fetch documentation with --depth (shallow clone) option

Should be pretty safe to assume shallow clone is available.

peterhoeg avatar Nov 09 '12 06:11 peterhoeg

So that would be 1.5.0.rc0.129.gf4bf2.

peterhoeg avatar Nov 09 '12 06:11 peterhoeg

We could maybe try it in the master branch only without any test whatsoever and wait for people to complain. Without any such feedback we could maybe think about keeping it that way in the next stable? Or we could insist on the installer being prepared to deal with more than 6 years old dependencies... In any case, let's just install a shallow clone installer version in master only and see what happens.

@DarwinAwardWinner, what do you think?

dimitri avatar Nov 10 '12 21:11 dimitri