]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/forum/How_does_ikiwiki_remember_times__63__.mdwn
(no commit message)
[ikiwiki.git] / doc / forum / How_does_ikiwiki_remember_times__63__.mdwn
index cb14df77f7881a867e3178d88af6e6ad7345bc34..6ce576db118cb1153c43cce898e3ec524aeb8b02 100644 (file)
@@ -89,19 +89,21 @@ Do I have it right?
 >>>>> -- [[Jon]]
 
 > A quick workaround for me to get modification times right is the following
-> little zsh script, which unfortynately only works for git:
+> little zsh script, which unfortunately only works for git:
 
     #!/usr/bin/env zsh
     
     set +x
     
     for FILE in **/*(.); do
-      TIMES="`git log --follow  --pretty=format:%ai $FILE`"
-      #CTIME="`echo $TIMES | tail -n1`"
+      TIMES="`git log --pretty=format:%ai $FILE`"
       MTIME="`echo $TIMES | head -n1`"
     
-      echo  touch -m -d "$MTIME" $FILE
-      touch -m -d "$MTIME" $FILE
+      if [ ! -z $MTIME ]; then
+        echo  touch -m -d "$MTIME" $FILE
+        touch -m -d "$MTIME" $FILE
+      fi
     
     done
 
+> --[[David_Riebenbauer]]