5 # Sets mtime and atime of files to the latest commit time in git.
7 # This is useful after the first clone of the rsync repository BEFORE you
8 # do any building. It is also safe if you have done a "make distclean".
12 my $prefix = @ARGV && $ARGV[0] =~ s/^--prefix=// ?
shift : '';
15 open FH
, 'git ls-files -z|' or die $!;
23 open FH
, "git log -r --name-only --no-color --pretty=raw -z @ARGV |" or die $!;
26 if (/^committer .*? (\d+) (?:[\-\+]\d+)$/) {
28 } elsif (s/\0\0commit [a-f0-9]{40}$// or s/\0$//) {
29 my @files = delete @ls{split(/\0/, $_)};
30 @files = grep { defined $_ } @files;
32 map { s/^/$prefix/ } @files;
33 utime $commit_time, $commit_time, @files;