2 # Sets mtimes of all files in the tree their last change date
3 # based on git's log. Useful to avoid too new dates after a
4 # fresh checkout, which lead to ikiwiki unnecessarily rebuilding
5 # basewiki files on upgrade.
7 for file in $(git ls-files); do
8 date="$(git log -1 --date=rfc "$file" | grep ^Date: | sed -e 's/Date://')"
9 if [ -n "$date" ]; then