git鹤嘴锄找不到修改的线

git鹤嘴锄找不到修改的线,git,Git,今天早些时候,我正在搜索将函数名从getReportHtml更改为getReport的提交 我用鹤嘴锄找不到它,所以我用手工搜索找到了它 现在我知道哪个提交发生了更改,我可以在git diff输出中看到更改: - function getReportHtml(filters) { + function getReport(type, filters) { 我尝试了以下搜索: git log -SgetReportHtml git log

今天早些时候,我正在搜索将函数名从
getReportHtml
更改为
getReport
的提交

我用鹤嘴锄找不到它,所以我用手工搜索找到了它

现在我知道哪个提交发生了更改,我可以在git diff输出中看到更改:

-               function getReportHtml(filters) {
+               function getReport(type, filters) {
我尝试了以下搜索:

git log -SgetReportHtml
git log -SgetReportHtml --diff-filter=M
git log -GgetReportHtml
他们找到了提交,但没有找到更改名称的提交

这是git日志手册页的相关部分:

   -S<string>
       Look for differences that change the number of occurrences of the specified string (i.e. addition/deletion) in a file. Intended for the scripter's use.

       It is useful when you're looking for an exact block of code (like a struct), and want to know the history of that block since it first came into being: use the feature iteratively
       to feed the interesting block in the preimage back into -S, and keep going until you get the very first version of the block.

   -G<regex>
       Look for differences whose patch text contains added/removed lines that match <regex>.
-S
查找更改文件中指定字符串(即添加/删除)出现次数的差异。供编剧使用。
当您正在寻找一个精确的代码块(如结构)并且想要知道该块自诞生以来的历史时,它非常有用:迭代地使用该特性
将前图像中感兴趣的块反馈回-S,并继续操作,直到获得块的第一个版本。
-G
查找其修补程序文本包含匹配的添加/删除行的差异。
引入更改的提交确实更改了“getReportHtml”的出现次数。那么为什么它没有被鹤嘴锄找到呢?

你能试试git日志--all-GgetReportHtml吗?另外,您使用的是什么版本的git?