Since you are looking for the “first time” when something is being introduced, you can try using git bisect
instead .
He walks you through setting the point “it's not here” and “it's definitely here,” and then displays the various commits (asking “is this here?”) Until he isolates where he is.
It is also not blindly going through the story linearly, but rather "bisecting" the tree, as if you were looking for a binary tree.
It is slightly slower than grep for the whole story, but more useful for a general attempt to track the “first time” of anything else; The main use case is "when the first time this error could occur."
Then it would be wise to see which branches include this commit using git branch --contains <commit>
.
source share