Re: [PATCH] .gitattributes: Enable cpp diff parsing for .[ch] files

2 messages, 2 authors, 2011-08-26 · open the first message on its own page

Re: [PATCH] .gitattributes: Enable cpp diff parsing for .[ch] files

From: Junio C Hamano <hidden>
Date: 2011-08-26 20:54:24

Linus Torvalds [off-list ref] writes:
On Thu, Aug 25, 2011 at 3:37 PM, Boaz Harrosh [off-list ref] wrote:
quoted
Add a .gitattributes file to the Linux tree to enable cpp parsing
of the source files.
Hmm. I'm not entirely conviced. If people really think that the hunk
description matters that much, maybe we should just instead improve on
the automatic diff detection, and extend it from just binary-vs-text,
to also do the common hunk-headers.

After all, not having a diff pattern already *does* mean "automatic",
so it would be just a rather trivial extension to that.
Not quite sure what you exactly mean by "extend it from just binary-vs-text".
Do you mean update buffer_is_binary() and add source language detection?

See also:

    http://thread.gmane.org/gmane.comp.version-control.git/180103/focus=180113

Re: [PATCH] .gitattributes: Enable cpp diff parsing for .[ch] files

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2011-08-26 21:00:01

On Fri, Aug 26, 2011 at 1:54 PM, Junio C Hamano [off-list ref] wrote:
Not quite sure what you exactly mean by "extend it from just binary-vs-text".
Do you mean update buffer_is_binary() and add source language detection?
Yes. Except the "detection" would be just "if we auto-detect it as
text, then use the standard file extensions to also make an automatic
hunk rule detection".

So it would do the most common cases (*.[Cch] etc)

                         Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help