开发者

Search through git revisions for method call

开发者 https://www.devze.com 2023-03-09 08:58 出处:网络
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.

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 th开发者_运维技巧rough these revisions to find when that was, or will we need to do a manual binary search through the revisions?


You can use the Git "pickaxe":

git log -SYourFunctionName

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

0

精彩评论

暂无评论...
验证码 换一张
取 消