On 2023-08-02 11:09, Sergey Poznyakoff wrote:
Some time ago Bruno Haible suggested a simpler approach, which may be
better for GNU tar's users. Here's the idea, which requires two passes
over the input files, the first to collect timestamp info:
I like the idea, although I doubt that its implementation would be less
complicated than the above.
Yes, it'd be more work for Tar. Less work for Tar's users, I hope.
So we assume that --reproducible-mtime option would work only for git,
right?
It should work for any version-control system. It doesn't even assume a
version control system, or that you use a timestamp-based build system
like 'make'. All it assumes is that you have source files maintained by
hand with reliable timestamps, and that you did a build sequentially
from scratch with an increasing clock so that build products' timestamps
are in ascending order and have timestamps greater than the newest
source file.
In short, it looks like we have to find a better way to extract mtimes
from git.
One possibility is to parse the output of the command "git log --raw
--pretty=format:%ct". Admittedly this will be a bit of work.