I want to be able to find a certain string which was introduced in any commit in
any branch, how can I do that? I found something (that I modified for Win32),
but git whatchanged
doesn't seem to be looking into the different branches
(ignore the py3k chunk, it's just a msys/win line feed fix)
git whatchanged -- <file> | \
grep "^commit " | \
python -c "exec(\"import sys,msvcrt,os\nmsvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)\nfor l in sys.stdin: print(l.split()[1])\")" | \
xargs -i% git show origin % -- <file>
It doesn't really matter if your solution is slow.