From: Mischa POSLAWSKY Date: Thu, 3 Feb 2011 18:54:01 +0000 (+0100) Subject: find header lines near the end of commit messages X-Git-Url: http://git.shiar.net/git-grep-footer.git/commitdiff_plain/8c39968d651166e9d325edaf2fb48c54c3bd8b39 find header lines near the end of commit messages --- 8c39968d651166e9d325edaf2fb48c54c3bd8b39 diff --git a/git-grep-footer b/git-grep-footer new file mode 100755 index 0000000..026f5bc --- /dev/null +++ b/git-grep-footer @@ -0,0 +1,11 @@ +#!/bin/sh +git log --pretty=%b%x00 "$@" | +perl -n0 -wMstrict -E ' + for (reverse split /\n\n/) { + my @headers = grep m{ + ^ (?: [a-z]+ (?: (?:-\w+)+ | \ by ) ) : \s* \S + }imx, split /\n/ or next; + say for @headers; + last; + } +'