Smashery
Smashery

Reputation: 59683

Search through git revisions for method call

We have a function in our code which isn't being called, but should be. We know it was being called in a version of our software released about 2 years ago.

So at some point in the past few thousand revisions of our code (in a git repository), this function call was removed, and we need to know when this was.

Is there a way to automatically search through these revisions to find when that was, or will we need to do a manual binary search through the revisions?

Upvotes: 4

Views: 273

Answers (1)

Greg Hewgill
Greg Hewgill

Reputation: 994401

You can use the Git "pickaxe":

git log -SYourFunctionName

This will show revisions where text containing YourFunctionName was either added or removed.

Upvotes: 7

Related Questions