File tree 1 file changed +10
-11
lines changed
1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change 1
1
# !/usr/bin/perl
2
2
# Sets mtimes of all files in the reprository their last change date
3
- # based on git's log. Useful to avoid too new dates after a
4
- # checkout.
3
+ # based on git's log. Useful to avoid too new dates after a checkout.
5
4
6
5
my %seen ;
7
6
my $date ;
8
7
open (LOG, " git log --pretty=format:'date: %ct ' --name-only |" ) || die " git log failed: $! " ;
9
8
while (<LOG>) {
10
- chomp ;
11
- if (/ ^date: (\d +)$ / ) {
12
- $date =$1 ;
13
- }
14
- elsif (! /^$/ && ! $seen {$_ }) {
15
- $seen {$_ }=1;
16
- # git log can list deleted files, so error is ignored
17
- utime ($date , $date , $_ );
18
- }
9
+ chomp ;
10
+ if (/ ^date: (\d +)$ / ) {
11
+ $date =$1 ;
12
+ }
13
+ elsif (! /^$/ && ! $seen {$_ }) {
14
+ $seen {$_ }=1;
15
+ # git log can list deleted files, so error is ignored
16
+ utime ($date , $date , $_ );
17
+ }
19
18
}
20
19
close LOG || die " git log failed: $! " ;
You can’t perform that action at this time.
0 commit comments