aboutsummaryrefslogtreecommitdiff
path: root/_scripts
diff options
context:
space:
mode:
Diffstat (limited to '_scripts')
-rwxr-xr-x_scripts/postinfo21
1 files changed, 21 insertions, 0 deletions
diff --git a/_scripts/postinfo b/_scripts/postinfo
new file mode 100755
index 0000000..95fe872
--- /dev/null
+++ b/_scripts/postinfo
@@ -0,0 +1,21 @@
+#!/bin/sh
+file="$1"
+tab="$(printf '\t')"
+
+history="$(git log \
+ --follow \
+ --ignore-all-space --diff-filter=AM \
+ --date=short --pretty=format:"%cd$tab%an" \
+ -- "$file")"
+
+dates="$(echo "$history" | cut -d"$tab" -f1)"
+authors="$(echo "$history" | cut -d"$tab" -f2 | sort -u)"
+
+cat << EOF
+date: $(echo "$dates" | head -n1)
+date_initial: $(echo "$dates" | tail -n1)
+edits: $(echo "$dates" | wc -l)
+authors:
+$(echo "$authors" | sed 's/^/- /')
+EOF
+