find header lines near the end of commit messages
[git-grep-footer.git] / git-grep-footer
1 #!/bin/sh
2 git log --pretty=%b%x00 "$@" |
3 perl -n0 -wMstrict -E '
4         for (reverse split /\n\n/) {
5                 my @headers = grep m{
6                         ^ (?: [a-z]+ (?: (?:-\w+)+ | \ by ) ) : \s* \S
7                 }imx, split /\n/ or next;
8                 say for @headers;
9                 last;
10         }
11 '