public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: set git diff driver for C source code files
@ 2017-02-21  9:06 Sven Eckelmann
  2017-02-21 17:26 ` Sven Eckelmann
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Eckelmann @ 2017-02-21  9:06 UTC (permalink / raw)
  To: b.a.t.m.a.n

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


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

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: set git diff driver for C source code files
  2017-02-21  9:06 [B.A.T.M.A.N.] [PATCH] batman-adv: set git diff driver for C source code files Sven Eckelmann
@ 2017-02-21 17:26 ` Sven Eckelmann
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Eckelmann @ 2017-02-21 17:26 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 729 bytes --]

On Dienstag, 21. Februar 2017 10:06:40 CET Sven Eckelmann wrote:
> 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>
> ---

Applied in e3bab02816097f860545d9ce9ae0808c69d7c92f [1].

Kind regards,
	Sven

[1] https://git.open-mesh.org/batman-adv.git/commit/e3bab02816097f860545d9ce9ae0808c69d7c92f

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2017-02-21 17:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-21  9:06 [B.A.T.M.A.N.] [PATCH] batman-adv: set git diff driver for C source code files Sven Eckelmann
2017-02-21 17:26 ` Sven Eckelmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox