Re:See the History of a Method with Git log -L
by chiefalchemist on Sunday November 05, 2023 @12:50PM
(#38153532)
How can this be uses with PHP?
[ Parent
| on HN ]
Re:See the History of a Method with Git log -L
by mschuster91 on Sunday November 05, 2023 @01:44PM
(#38154187)
According to `man gitattributes` [1] a `*.php diff=php` should be enough.
Re:See the History of a Method with Git log -L
by OJFord on Sunday November 05, 2023 @02:30PM
(#38154704)
It's just a regex to match the line you want to see the history of. Function would be a common case, but it's completely arbitrary.
For example, `git log -L:members:Cargo.toml` will show the history of constituent rust projects in a Cargo workspace.
Re:See the History of a Method with Git log -L
by staunton on Sunday November 05, 2023 @02:38PM
(#38154794)
It's a regex? Is it even guaranteed to work then? I would think you have to parse non-regular languages to always find the end of a function in a some languages?
Re:See the History of a Method with Git log -L
by simonw on Sunday November 05, 2023 @03:26PM
(#38155293)
There's a comment about that here: https://github.com/git/git/blob/bc5204569f7db44d22477485afd5...
When writing or updating patterns, assume that the contents these
patterns are applied to are syntactically correct. The patterns
can be simple without implementing all syntactical corner cases, as
long as they are sufficiently permissive.
Re:See the History of a Method with Git log -L
by staunton on Sunday November 05, 2023 @03:35PM
(#38155392)
Wow, that file must be paradise for regex nerds, assuming there are any such...
Re:See the History of a Method with Git log -L
by tessierashpool on Sunday November 05, 2023 @03:58PM
(#38155576)
there are, I am, and it's not (sorry). some languages have the ability to comment regexes, and that would be very useful here.
Re:See the History of a Method with Git log -L
by staunton on Sunday November 05, 2023 @06:21PM
(#38156802)
It has lots of comments inside the regexes. How would this better comment support look like?
Re:See the History of a Method with Git log -L
by sundarurfriend on Monday November 06, 2023 @12:40AM
(#38159269)
[delayed]
Re:See the History of a Method with Git log -L
by sundarurfriend on Monday November 06, 2023 @12:27AM
(#38159192)
there are, I am, and it is. (Except for the proliferation of backslashes due to C not having "raw" strings.)