OSDN Git Service

Keep the file timesamp of commit time git_support
authorumorigu <umorigu@gmail.com>
Tue, 10 Jun 2014 16:39:36 +0000 (01:39 +0900)
committerumorigu <umorigu@gmail.com>
Tue, 10 Jun 2014 16:39:36 +0000 (01:39 +0900)
release.sh

index 968a8cb..8ddc489 100755 (executable)
@@ -205,6 +205,15 @@ if [ "$__git" ] ; then
   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