I want to use git log
to show all commits that do not match a given pattern. I know I can use the following to show all commits that do match a pattern:
As mentioned by VonC the best option is if you can update to Git 2.4.0 (which is currently on RC2). But even if you can't do that there is no reason for elaborate scripts. A (gnu) awk one-liner should do it. git log
has the useful -z
option to separate commits by a NUL-character which makes it easy to parse them:
git log -z --pretty --stat | awk 'BEGIN{ RS="\0"; FS="\n\n" } !match($2, //)'
If you don't have gnu awk, you probably should at least install that. Or port this script to your specific awk version, which I leave as an exercise for the reader ;-).