I am trying to find a function that was deleted at some point in time. I tried to use git log -L :<funcname>:<file> to locate the function that was deleted. The result ends up being fatal: -L parameter '<funcname>' starting at line 1: no match.
For example if I am searching for function findMe.
I enter git log -L :findMe:index.php
index.php
<?php
class stuff {.....}
class otherStuff{....}
class moreStuff{
public function test(){...}
public function findMe() {....}
public function test1() {....}
}
?>
Result fatal: -L parameter '<funcname>' starting at line 1: no match.
Reference git log:
-L :<funcname>:<file>
If
“:<funcname>”is given in place of<start>and<end>, it is a regular expression that denotes the range from the first funcname line that matches<funcname>, up to the next funcname line.“:<funcname>”searches from the end of the previous-Lrange, if any, otherwise from the start of file.“^:<funcname>”searches from the start of file.