See the History of a Method with Git log -L
calebhearth.com
See the History of a Method with Git log -L
1–10 of 26 posts
Re: See the History of a Method with Git log -L
#2Re: See the History of a Method with Git log -L
#3How can this be uses with PHP?
Re: See the History of a Method with Git log -L
#4Re: See the History of a Method with Git log -L
#5Re: See the History of a Method with Git log -L
#6How can this be uses with PHP?
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
#7How can this be uses with PHP?
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.
Indeed, it does not always work correctly for Julia, as an arbitrary example I tried. Seems like it goes by indentation? Still nice though and worked out of the box!
Re: See the History of a Method with Git log -L
#8Re: See the History of a Method with Git log -L
#9Here's how support for Python and Ruby are defined:
PATTERNS("python",
"^[ \t]*((class|(async[ \t]+)?def)[ \t].*)$",
/* -- */
"[a-zA-Z_][a-zA-Z0-9_]*"
"|[-+0-9.e]+[jJlL]?|0[xX]?[0-9a-fA-F]+[lL]?"
"|[-+*/%&^|=!]=|//=?|>=?|\\*\\*=?"),
/* -- */
PATTERNS("ruby",
"^[ \t]*((class|module|def)[ \t].*)$",
/* -- */
"(@|@@|\\$)?[a-zA-Z_][a-zA-Z0-9_]*"
"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+|\\?(\\\\C-)?(\\\\M-)?."
"|//=?|[-+*/%&^|=!]=|>=?|===|\\.{1,3}|::|[!=]~"),Re: See the History of a Method with Git log -L
#10Earlier quoted context omitted.
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.
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? Indeed, it does not always work correctly for Julia, as an arbitrary example I tried. Seems like it goes by indentation? Still nice though and worked out of the box!
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.