All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 123/127] .gitattributes: set git diff driver for C source code files
@ 2016-10-08  0:03 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2016-10-08  0:03 UTC (permalink / raw)
  To: torvalds, mm-commits, akpm, jdelvare, corbet, joe, peterz

From: Jean Delvare <jdelvare@suse.de>
Subject: .gitattributes: set git diff driver for C source code files

Git can be told to apply language-specific rules when generating diffs. 
Enable this for C source code files (*.c and *.h) so that function names
are printed right.  Specifically, doing so prevents "git diff" from
mistakenly considering unindented goto labels as function names.

Link: http://lkml.kernel.org/r/20160907143403.1449324f@endymion
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Joe Perches <joe@perches.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 .gitattributes |    2 ++
 1 file changed, 2 insertions(+)

diff -puN /dev/null .gitattributes
--- /dev/null
+++ a/.gitattributes
@@ -0,0 +1,2 @@
+*.c   diff=cpp
+*.h   diff=cpp
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-10-08  0:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-08  0:03 [patch 123/127] .gitattributes: set git diff driver for C source code files akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.