Re: [PATCH] git-http-fetch: Allow caching of retrieved objects byproxy servers
From: sf <hidden>
Date: 2016-06-15 22:42:06
Petr Baudis wrote:
Dear diary, on Mon, Sep 19, 2005 at 12:24:45PM CEST, I got a letter where sf [off-list ref] told me that...
...
quoted
The OP assumed that "files in a GIT repository are immutable" which is not true. If you consider the sequence pack -> prune -> update zlib or git -> unpack you can end up with different files if the new zlib implementation changes imcompatibly (with respect to byte-by-byte compression results) or if git suddenly does not use the default compression level any more.Yes, but why should this matter? It shouldn't matter if you get the old "version" or the new version of the file over HTTP, the actual object's contents is still the same, and GIT shouldn't care.
This is correct as long as you take care to always get each file in one go. Recently there was talk about how git handles objects larger than 4GB. But you do not have to go this far. Think about fetching 1MB (or 10MB or 100MB) compressed objects over a slow link. If the transfer gets interrupted some people or some clever piece of software - perhaps even in git-core - might try to continue the interrupted download. Now if the file representation has changed in the meantime the downloaded file is going to be corrupt. The git tools will of course take note of the corruption but then the head scratching begins: "What went wrong?" The more I think about this I realize that my worries have nothing to do with caching but with HTTP fetching in general. Regards Stephan