LKML Archive on lore.kernel.org
 help / Atom feed
* [PATCH] Set git diff driver for C source code files
@ 2016-09-07 12:34 Jean Delvare
  0 siblings, 0 replies; 1+ messages in thread
From: Jean Delvare @ 2016-09-07 12:34 UTC (permalink / raw)
  To: LKML; +Cc: Peter Zijlstra, Joe Perches, Jonathan Corbet, Andrew Morton

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.

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>
---
 .gitattributes |    2 ++
 1 file changed, 2 insertions(+)

--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-4.7/.gitattributes	2016-09-07 14:07:23.042138220 +0200
@@ -0,0 +1,2 @@
+*.c   diff=cpp
+*.h   diff=cpp


-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 1+ messages in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-07 12:34 [PATCH] Set git diff driver for C source code files Jean Delvare

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox