aboutsummaryrefslogtreecommitdiff
path: root/fixup_file_mtime.sh
diff options
context:
space:
mode:
Diffstat (limited to 'fixup_file_mtime.sh')
-rwxr-xr-xfixup_file_mtime.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/fixup_file_mtime.sh b/fixup_file_mtime.sh
new file mode 100755
index 000000000..662c16dbd
--- /dev/null
+++ b/fixup_file_mtime.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+#
+# Description: Fix up the file mtimes based on the git log.
+
+set -u -o pipefail
+
+if [[ ! -f 'coredns.1.md' ]]; then
+ echo 'ERROR: Must be run from the top of the git repo.'
+ exit 1
+fi
+
+for file in coredns.1.md corefile.5.md plugin/*/README.md; do
+ time=$(git log --pretty=format:%cd -n 1 --date='format:%Y%m%d%H%M.%S' "${file}")
+ touch -m -t "${time}" "${file}"
+done