Downloading sourcecode without re-downloading prev

I've had a bit of a search but so far this seems like a new question:

For those of us who pay by volume or have slow connections, re-downloading the entire set of days of code just to get the latest one seems inefficient and expensive.

I'm wondering what alternatives there are, other than something like the attached that reads only as much of the file over the internet as needed to get at the requested contained item...?

The attached is designed for use in LinqPad5.
It's not overly efficient in terms of caching or read-ahead to cut down on HTTP requests, but it does the job. Note it includes a URL I was using for testing, not a real link to the actual code - I leave it as an exercise for the user to fill that in, along with where to save it locally.


[attachment=58]HttpZip.zip[/attachment]


1
(c:
Well if you have preorder, you can always pull code from github. If you pull new code every day then only small amount of code will be downloaded. And if you are cloning from scratch then you can instruct github to download only latest code and not all history (--depth=1 argument). Basically this will do the trick:
1
git clone --depth=1 https://github.com/HandmadeHero/cpp.git

Or if you don't have git installed, you can download latest source as zip file:
1
https://github.com/HandmadeHero/cpp/archive/master.zip

It also works for older commits - look up the commit in history and use the same "Download ZIP" button. For example, day 193:
1
https://github.com/HandmadeHero/cpp/archive/b37f1f88f860b5b0ad4938cc40c8dbbb95150f63.zip


Instructions of accessing github are available in your SendOwl link.

Edited by Mārtiņš Možeiko on
Ah, cool - I am waiting for payday before preordering, so wasn't aware of the git repo - that makes things way easier.

Still, it was a fun experiment to write that tool anyway.

1
(c: