qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Akihiko Odaki <akihiko.odaki@gmail.com>
To: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philippe.mathieu.daude@gmail.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	qemu-trivial@nongnu.org,
	"Christian Schoenebeck" <qemu_oss@crudebyte.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	qemu-devel@nongnu.org, "Gerd Hoffmann" <kraxel@redhat.com>
Subject: Re: [PATCH] gitattributes: Cover Objective-C source files
Date: Sat, 19 Mar 2022 12:25:35 +0900	[thread overview]
Message-ID: <a37d98d4-5fdf-8a57-af64-eab4daacf49d@gmail.com> (raw)
In-Reply-To: <2ab1e5f9-6a34-6b82-8f43-b7dcf58bc8b1@gmail.com>

On 2022/03/19 1:14, Philippe Mathieu-Daudé wrote:
>> 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.
> 
> 'git-diff --function-context' doesn't work for me without this change.

With some debugging, I found Apple's Git distribution actually carries a 
default gitattributes file which annotates *.m.
https://github.com/apple-opensource/Git/blob/master/gitattributes

However, it does not annotate *.c or *.h. Apparently there is no "c" 
diff pattern and they are handled with the "default" diff pattern which 
is actually designed for C. In fact, "c" diff pattern is not present in 
the documentation:
https://git-scm.com/docs/gitattributes#_defining_an_external_diff_driver

In conclusion, *.m should be listed in gitattributes but *.c.inc and 
*.h.inc should not be if my understanding is correct.

Paolo Bonzini, I found you are the author of commit 29cf16db23. Can you 
test the above conclusion?

Regards,
Akihiko Odaki


  reply	other threads:[~2022-03-19  3:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17 13:03 [PATCH] gitattributes: Cover Objective-C source files Philippe Mathieu-Daudé
2022-03-18 14:10 ` Philippe Mathieu-Daudé
2022-03-18 14:42   ` Akihiko Odaki
2022-03-18 16:14     ` Philippe Mathieu-Daudé
2022-03-19  3:25       ` Akihiko Odaki [this message]
2022-03-19 13:49         ` Philippe Mathieu-Daudé
2022-03-19 14:03           ` Akihiko Odaki
2022-03-18 14:36 ` Christian Schoenebeck
2022-03-28 22:30 ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a37d98d4-5fdf-8a57-af64-eab4daacf49d@gmail.com \
    --to=akihiko.odaki@gmail.com \
    --cc=f4bug@amsat.org \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philippe.mathieu.daude@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=qemu_oss@crudebyte.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).