Is git archive output supposed to be bit-repeatable through git versions?

166 Views Asked by At

I am using git archive to generate a file which is later hashed to be checked for integrity against a pre-stored hash. However I have not seen anywhere that git archive is intended for bit repeatability, so I fear that any future changes in git itself, tar, or some other internals may suddenly lead to a different archive being produced from the same repository.

I am right in that this is not an intended use of git archive? Or can I use it confidently like this?

1

There are 1 best solutions below

3
bk2204 On BEST ANSWER

This is not an intended feature of git archive. The tar archives generated have changed before to fix bugs. There are some people who try to rely on this nevertheless, including kernel.org, but their systems have been broken when Git updates. I strongly advise against doing this.

Anything using compression (including gzipped tar archives and zip files) is inherently unreproducible because the compression can change between versions of zlib or gzip, as appropriate.