diff mbox

support/download: really, really make git archives reproducible

Message ID 1456610595-8715-1-git-send-email-yann.morin.1998@free.fr
State Accepted
Commit 87731820926cd6f51879d7b89687bfec2e615b3d
Headers show

Commit Message

Yann E. MORIN Feb. 27, 2016, 10:03 p.m. UTC
The way we use it, gzip will store the current time in the header, which
leads to unreproducible archives.

Fiss that by telling gzip to not store the name and date of the file it
compresses, with the -n option. Since it compresses its stdin, there was
already no filename stored; now there's even no date stored.

Note: gzip has had -n since at least 1.2.4, released in 1993, so
virtually every gzip out there nowadays has it.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 support/download/git | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Korsgaard Feb. 27, 2016, 10:18 p.m. UTC | #1
>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > The way we use it, gzip will store the current time in the header, which
 > leads to unreproducible archives.

 > Fiss that by telling gzip to not store the name and date of the file it
 > compresses, with the -n option. Since it compresses its stdin, there was
 > already no filename stored; now there's even no date stored.

 > Note: gzip has had -n since at least 1.2.4, released in 1993, so
 > virtually every gzip out there nowadays has it.

 > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Committed, thanks.
diff mbox

Patch

diff --git a/support/download/git b/support/download/git
index e342ed3..314b388 100755
--- a/support/download/git
+++ b/support/download/git
@@ -55,4 +55,4 @@  fi
 GIT_DIR="${basename}" \
 _git archive --prefix="'${basename}/'" -o "'${output}.tmp'" --format=tar "'${cset}'"
 
-gzip <"${output}.tmp" >"${output}"
+gzip -n <"${output}.tmp" >"${output}"