今天早些时候,我正在搜索更改函数名称的提交getReportHtml
to getReport
.
我用镐找不到它,所以我通过手动搜索找到了它。
现在我知道哪个提交发生了更改,我可以在 git diff 输出中看到更改:
- function getReportHtml(filters) {
+ function getReport(type, filters) {
我尝试了以下搜索:
git log -SgetReportHtml
git log -SgetReportHtml --diff-filter=M
git log -GgetReportHtml
他们找到了提交,但没有找到更改名称的提交。
这是 git-log 手册页的相关部分:
-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>.
引入更改的提交确实更改了“getReportHtml”的出现次数。那么为什么镐没有发现它呢?
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)