This has been bugging me for a while and searching has yielded no hints.
Issue:
When I do a git diff
on a PHP file containing a Class
, each hunk description has the class name with no mention of the method name.
For example:
@@ -351,7 +351,7 @@ class Session
$form->setError($field, $subpassValid['msg']);
}
// E-Mail address error checking
$field = "email"; //Use field name for email
- if(!isset($subemail) || strlen($subemail = trim($subemail)) == 0){
+ if(!$subemail || strlen($subemail = trim($subemail)) == 0){
$form->setError($field, "* Email not entered");
@@ -373,7 +373,7 @@ class Session
...
Question:
Is there a way to tell git
to show method names instead of/along side of the class name?
Edit:
Additional Information:
diff version: 2.8.1
git version: 1.7.6 (from the git-core PPA)
OS: Ubuntu 9.10
I originally had git version 1.7.0.4 from the stock Ubuntu repos, but updated it hoping that it was a bug. Unfortunately that didn't solve the issue.
Edit2:
After more testing, it appears that if the function declaration is indented at all (with either spaces or tabs) git diff
doesn't pick up the function name. This appears to be a bug in git
.