All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Joe Perches <joe@perches.com>, Jonathan Corbet <corbet@lwn.net>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] Set git diff driver for C source code files
Date: Wed, 7 Sep 2016 14:34:03 +0200	[thread overview]
Message-ID: <20160907143403.1449324f@endymion> (raw)

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

             reply	other threads:[~2016-09-07 12:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-07 12:34 Jean Delvare [this message]
     [not found] <20221025191552.60658-1-a.clayton@nginx.com>
2022-10-25 19:26 ` [PATCH] Set git diff driver for C source code files Alejandro Colomar

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=20160907143403.1449324f@endymion \
    --to=jdelvare@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    /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 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.