Control: retitle -1 build tarballs reproducibly (compression level and date)
Actually, it's more than the compression level - because of the way gbp builds the tarball, it can't build the tarball reproducibly. Or at least, it varies from what would be expected from git archive $tag. According to strace(1), gbp calls the equivalent of this on the commandline: git archive --format=tar --prefix=tty-clock-2.2/ 71343a5968157b95f15b3b1ca0856874 | gzip -9nc 71343a5968157b95f15b3b1ca0856874 is the *tree* associated with the requested tag (!!). The tree has no notion of timestamp at all, so git will assign the current time as mtime fields in the generated tarball. The proper pipeline would be, in my case: git archive --format=tar --prefix=tty-clock-2.2/ v2.2 | gzip -nc Changes: no -9, and using the tag directly instead of the tree. This way, git knows what timestamp to put in the tarball, and will always create the same tarball if the same tag is given. This is the diffoscope output between those two pipelines: $ diffoscope a b |################################################################################################################################################| 100% Time: 0:00:00 --- a +++ b ├── metadata │ @@ -1 +1 @@ │ -gzip compressed data, max compression, from Unix │ +gzip compressed data, from Unix │ --- a-content ├── +++ b-content │ ├── file list │ │ @@ -1,7 +1,7 @@ │ │ -drwxrwxr-x 0 root (0) root (0) 0 2017-01-15 03:41:27.000000 tty-clock-2.2/ │ │ --rw-rw-r-- 0 root (0) root (0) 26 2017-01-15 03:41:27.000000 tty-clock-2.2/.gitignore │ │ --rw-rw-r-- 0 root (0) root (0) 1434 2017-01-15 03:41:27.000000 tty-clock-2.2/Makefile │ │ --rw-rw-r-- 0 root (0) root (0) 1379 2017-01-15 03:41:27.000000 tty-clock-2.2/README │ │ --rw-rw-r-- 0 root (0) root (0) 3232 2017-01-15 03:41:27.000000 tty-clock-2.2/tty-clock.1 │ │ --rw-rw-r-- 0 root (0) root (0) 20471 2017-01-15 03:41:27.000000 tty-clock-2.2/ttyclock.c │ │ --rw-rw-r-- 0 root (0) root (0) 4183 2017-01-15 03:41:27.000000 tty-clock-2.2/ttyclock.h │ │ +drwxrwxr-x 0 root (0) root (0) 0 2017-01-13 22:02:02.000000 tty-clock-2.2/ │ │ +-rw-rw-r-- 0 root (0) root (0) 26 2017-01-13 22:02:02.000000 tty-clock-2.2/.gitignore │ │ +-rw-rw-r-- 0 root (0) root (0) 1434 2017-01-13 22:02:02.000000 tty-clock-2.2/Makefile │ │ +-rw-rw-r-- 0 root (0) root (0) 1379 2017-01-13 22:02:02.000000 tty-clock-2.2/README │ │ +-rw-rw-r-- 0 root (0) root (0) 3232 2017-01-13 22:02:02.000000 tty-clock-2.2/tty-clock.1 │ │ +-rw-rw-r-- 0 root (0) root (0) 20471 2017-01-13 22:02:02.000000 tty-clock-2.2/ttyclock.c │ │ +-rw-rw-r-- 0 root (0) root (0) 4183 2017-01-13 22:02:02.000000 tty-clock-2.2/ttyclock.h │ ╵ ╵ Note that the timestamps in "a" will reflect when the command is ran, not the tag timestamp. Thanks for considering this! A. -- Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. - Brian W. Kernighan