commit with filesystem date
authorDobrica Pavlinušić <dpavlin@rot13.org>
Thu, 29 Jun 2023 07:18:05 +0000 (09:18 +0200)
committerDobrica Pavlinušić <dpavlin@rot13.org>
Sun, 2 Jul 2023 11:12:08 +0000 (13:12 +0200)
git-commit-date [new file with mode: 0755]

diff --git a/git-commit-date b/git-commit-date
new file mode 100755 (executable)
index 0000000..54e196b
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh -x
+
+# preserve file timestamp in git date inside commit
+# usage: git-commit-date path
+
+git commit --date="$( ls --full-time $1  | awk '{ print $6" "$7 }' )" $1
+