git log -S <the-string>
If it’s commit messages I’m interested in: git log --grep <the-word-or-phrase>
Sometimes I want to know “all the commits that introduced a pattern”: git blame —- $(git grep -P -l 'the.*regex') | grep -P 'the.*regex'
This last one I use frequently enough that I wrote a little shell script for it, called "git-blep" (for "blame-grep") git log -L :<the-function-name>:<the-file-name>
Though that probably would not have worked in the original author’s case.
But, to merge we need to have all tests pass. (If tests flakily pass then we get new flakey tests, yay!)
I know git-bisect doesn’t support this: but could git-bayesect have an option to only consider merge commits? Being able to track a flake change back to an individual PR would be really useful.