public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: set git diff driver for C source code files
Date: Tue, 21 Feb 2017 10:06:40 +0100	[thread overview]
Message-ID: <20170221090640.14686-1-sven@narfation.org> (raw)

From: Jean Delvare <jdelvare@suse.de>

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>
[sven@narfation.org: Ported patch from linux.git]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 .gitattributes | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.gitattributes b/.gitattributes
index eeef3e0..1d2a7e9 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,2 +1,4 @@
 /.gitignore export-ignore
 /.gitattributes export-ignore
+*.c   diff=cpp
+*.h   diff=cpp
-- 
2.11.0


             reply	other threads:[~2017-02-21  9:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21  9:06 Sven Eckelmann [this message]
2017-02-21 17:26 ` [B.A.T.M.A.N.] [PATCH] batman-adv: set git diff driver for C source code files Sven Eckelmann

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=20170221090640.14686-1-sven@narfation.org \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox