qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gitattributes: Cover Objective-C source files


From: Akihiko Odaki
Subject: Re: [PATCH] gitattributes: Cover Objective-C source files
Date: Fri, 18 Mar 2022 23:42:52 +0900
User-agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

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é <f4bug@amsat.org>

See comments in commit 29cf16db23 ("buildsys: Help git-diff
adding .gitattributes config file") for details.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]