computercraft-github icon indicating copy to clipboard operation
computercraft-github copied to clipboard

Only download updated files

Open BrainStone opened this issue 2 years ago • 1 comments

It would be very nice if instead of always downloading everything this program could only download the files that changed.

So I think this can be achieved by storing the latest commit SHA in a file like .commit and when a repo is requested to be cloned check for that file and if it exists generate a diff and only downloading the files that were changed in that diff (I'm aware that just downloading and applying the file diff is way too difficult).

If this was added I'd argue it would make sense to add a flag to disable this behavior (or add a flag to enable it).

BrainStone avatar Jan 28 '23 06:01 BrainStone

The way to do this would be to store files in two places like git does; blobs and trees in a .git/objects folder, and the actual checkout in the working tree. You then only need to download the blobs that aren't already there.

On Sat, Jan 28, 2023, 07:44 Yannick Schinko @.***> wrote:

It would be very nice if instead of always downloading everything this program could only download the files that changed.

So I think this can be achieved by storing the latest commit SHA in a file like .commit and when a repo is requested to be cloned check for that file and if it exists generate a diff and only downloading the files that were changed in that diff (I'm aware that just downloading and applying the file diff is way too difficult).

If this was added I'd argue it would make sense to add a flag to disable this behavior (or add a flag to enable it).

— Reply to this email directly, view it on GitHub https://github.com/eric-wieser/computercraft-github/issues/35, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADH2LDCT4G2DAFENEHMM7DWUS54FANCNFSM6AAAAAAUJPNJGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

eric-wieser avatar Jan 28 '23 18:01 eric-wieser