aboutsummaryrefslogtreecommitdiff
path: root/fixdates.sh
blob: fc7f32a63a3335d4ebb9909d6c2f8928576813ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash 
 
thisdir="$(cd "$(dirname "$0")";pwd)"
cd "$thisdir"
git ls-files -z | \
while read -d $'\0' filename; do
    date="$(git log -n 1 --pretty='format:%ct' -- "$filename")"
    if [[ -n "$date" ]]; then
        echo "updating <$filename> to date <$date>"
        touch -d @"$date" "$filename"
    fi
done