When needing to find revisions that have a code change, in a Mercurial repository, one can use the command hg grep --all '<pattern>'
and get a pretty, colored output in the following format:
# filename : revision : +/- : line in file
filename.ext:100:+:The quick brown fox jumped over the lazy dog.
filename.ext:100:-:Teh quick brown fox jumped over the lazy dog.
filename.ext:95:+:Teh quick brown fox jumped over the lazy dog.
filename.ext:95:-:Teh quick brown fox jumped over the lazy doge.
I was wondering if there was a way to get output similar to this in a Git repository.
Edit: The closest I've been able to get to is the following:
> git rev-list --all | xargs git grep <pattern>
deadbe..ef6543:filename.ext:The quick brown fox jumped over the lazy dog.
deadbe..ef1324:filename.ext:Teh quick brown fox jumped over the lazy dog.
deadbe..ef243a:filename.ext:Teh quick brown fox jumped over the lazy doge.
Which I found from this answer: https://stackoverflow.com/a/39701177
Edit: I have been continuing to work and research this. As it stands right now, I think there is no "out-of-the-box" solution to be able to accomplish this. I now think the only way to achieve this is to build a script, or string together some complicated commands, and maybe store them as an alias.