diff options
author | dakkar <dakkar@sardina.(none)> | 2009-09-13 14:02:05 +0200 |
---|---|---|
committer | dakkar <dakkar@sardina.(none)> | 2009-09-13 14:02:05 +0200 |
commit | 554e76f48da5407c30277e316876f95db2a80f37 (patch) | |
tree | 0a3edbefb57cd89455555171fcf3a4add8cf6f2d | |
parent | errors.lst had no sense (diff) | |
download | thenautilus-554e76f48da5407c30277e316876f95db2a80f37.tar.gz thenautilus-554e76f48da5407c30277e316876f95db2a80f37.tar.bz2 thenautilus-554e76f48da5407c30277e316876f95db2a80f37.zip |
script to fix dates
scans all the files known to git, and touches each of them to the date
of the last commit that modified it
-rw-r--r-- | fixdates.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fixdates.sh b/fixdates.sh new file mode 100644 index 0000000..2b23944 --- /dev/null +++ b/fixdates.sh @@ -0,0 +1,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 |