aboutsummaryrefslogtreecommitdiff
path: root/_scripts/postinfo
blob: edc808b19cdb3b5c888e263ba048e076815a54e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
export LANG=C

file="$1"
tab="$(printf '\t')"

git log \
	--follow \
	--ignore-all-space --diff-filter=AM \
	--date=unix --pretty=format:"%H$tab%cd$tab%an" \
	-- "$file" |\
awk -F"$tab" '
BEGIN { printf("git_log:\n") }
{
	printf("  - hash: \"%s\"\n", $1)
	printf("    date: \"@%s\"\n", $2)
	printf("    author: \"%s\"\n", $3)
}
'