Skip to contentSkip to conversation

batman-adv: set git diff driver for C source code files

PATCH Applied Sven Eckelmann 1 participant 2 messages Feb 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: set git diff driver for C source code files

From: Jean Delvare <[email protected]>

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.

[[email protected]: Ported patch from linux.git]
---
 .gitattributes | 2 ++
 1 file changed, 2 insertions(+)
.gitattributes +2 -0
index eeef3e0..1d2a7e9 100644
@@ -1,2 +1,4 @@
 /.gitignore export-ignore
 /.gitattributes export-ignore
+*.c   diff=cpp
+*.h   diff=cpp
Signature · 1 line
2.11.0
author Applied
#1 lore raw
Quoted 11 lines · On Dienstag, 21. Februar 2017 10:06:40 CET Sven Eckelmann wrote:

From: Jean Delvare <[email protected]>

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.

[[email protected]: Ported patch from linux.git]

---

Applied in e3bab02816097f860545d9ce9ae0808c69d7c92f [1].

Kind regards,
Sven

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