I like git log -S for finding where a string appeared, but it only counts occurrences. When the line was edited and the string stayed, -S sees nothing. -G looks at the changed lines themselves.
git log -G'timeout\s*=' --oneline -p -- config/
The manual says -G looks for differences whose patch text contains added or removed lines that match the regular expression. So a commit that changes timeout = 5 into timeout = 30 is found, even though the number of timeout = occurrences did not change. -S would skip it, because it only finds commits that change how many times the string occurs.
Add -p to see the diff and -- path to limit the search to part of the tree, which also makes it faster. Searching a large history for a loose pattern can take a while, because git has to look at every patch.
Caveats: the regular expression is applied to the lines in the diff, so a pattern that spans two lines will not match. Binary files are ignored unless you pass --text. And quote the pattern, or the shell will eat the backslashes and asterisks.
Use -S for “when did this string appear or vanish” and -G for “when did this kind of line change”.
Further reading: git log, -G and -S (Git documentation)