OSDN Git Service

Keep the file timesamp of commit time
[pukiwiki/pukiwiki_devel.git] / release.sh
index c6794f7..8ddc489 100755 (executable)
@@ -199,8 +199,22 @@ else cmd="checkout"
 fi
 
 if [ "$__git" ] ; then
-  echo git clone --depth 10 --branch "$tag" "$gitrepo" "$pkg_dir"
-       git clone --depth 10 --branch "$tag" "$gitrepo" "$pkg_dir"
+  echo git clone "$gitrepo" "$pkg_dir"
+       git clone "$gitrepo" "$pkg_dir"
+  echo cd $pkg_dir 
+  cd $pkg_dir 
+  echo git reset --hard "$tag"
+       git reset --hard "$tag"
+
+  # Set file timestamp
+  for FILE in $(git ls-files); do
+    TIME=$(git log --pretty=format:%ci -n1 $FILE)
+    echo $TIME'\t'$FILE
+    STAMP=$(date -d "$TIME" +"%y%m%d%H%M.%S")
+    touch -t $STAMP $FILE
+  done
+
+  cd ..
 else
   exit
   echo cvs -z3 -d "$CVSROOT" -q "$cmd" -r "$tag" -d "$pkg_dir" "$mod"