I don't think this is needed. I could see a diff annotated with a method
name even without this change:
% git diff
diff --git a/ui/cocoa.m b/ui/cocoa.m
index cb6e7c41dc6..14a4416cc8b 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -1264,6 +1264,7 @@ - (id) init
[pauseLabel setTextColor: [NSColor blackColor]];
[pauseLabel sizeToFit];
}
+ //
return self;
}
Commit 29cf16db23 says:
Since commits 0979ed017f0 ("meson: rename .inc.h files to .h.inc")
and 139c1837db7 ("meson: rename included C source files to .c.inc")
'git-diff --function-context' stopped displaying C function context
correctly.
So I suspect Git has some knowledge of common file extensions like .c,
.h and .m although I couldn't find in the source code of Git.
Regards,
Akihiko Odaki
On 2022/03/18 23:10, Philippe Mathieu-Daudé wrote:
+qemu-trivial@
On 17/3/22 14:03, Philippe Mathieu-Daudé wrote:
From: Philippe Mathieu-Daudé <f4...@amsat.org>
See comments in commit 29cf16db23 ("buildsys: Help git-diff
adding .gitattributes config file") for details.
Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org>
---
.gitattributes | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitattributes b/.gitattributes
index 07f430e944..a217cb7bfe 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,3 +1,4 @@
*.c.inc diff=c
*.h.inc diff=c
+*.m diff=objc
*.py diff=python