Re: git-diff-tree rename detection bug
On Wed, 14 Sep 2005, H. Peter Anvin wrote:
>
> Well, git seems to assume it can mmap() the entirety of any file under
> its control, so a 64-bit git could handle larger files.
Right now git isn't 64-bit clean anyway (well, it should _work_ fine on 64-bit architectures, but it just can't handle files >32 bits).
I think the core object format should be all perfectly ok (since all the sizes etc are in ascii), so this is not a huge deal. If you have an existing git archive and suddenly notice that you need 32+ bit file formats, you don't have to throw your archive away and re-generate it from scratch in some new format.
In fact, I think even the streaming pack format is 64-bit-safe: it has binary sizes, but they are all length-encoded, and I think the data structure is safe.
Also, the index file - in order to not be unnecessarily big, and to be able to use standard htonl/ntohl helpers etc - uses 32-bit lengths for files. Even that _that_ should be 64-bit safe, because the length isn't actually _used_ for anything but to verify the curret state, and as with the timestamps etc, it's ok to "only" check the low 32 bits.
So the on-disk format should be capable of handling 64-bit entities.
HOWEVER. I might be wrong. I tried to think about it, but I didn't care too much, because I think git would suck at truly huge files. If only because compressing them will take forever. And the _implementation_ uses "unsigned int" and has never been tested with anything else, so it would need a lot of testing.
Also, the "pack index" file can only handle 32-bit offsets - you can make a pack-file that is bigger than that, and it should be fine from a _streaming_ standpoint (ie in the way we use them for network transport), but you can't index them in .git/objects/packs.
Which isn't a disaster: you might choose to say that you never pack huge files. That might be ok for some cases (maybe the huge file is a one-off satellite picture). It would suck if the huge file is a incrementally created log-file, where packing really would be nice.
IF we ever hit this, and IF people decide that git actually makes sense for those kinds of files, we CAN change the pack index format. It has a version number and everything, so we can even do it gently. Hopefully that would be the only actual on-disk format that would need to change. But regardless, the git code itself would need a lot of verification to make sure that it handles big files correctly.
I'm not seeing that as a high priority. Maybe in five years ;)
Linus