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