Skip to content

Commit 218dd85

Browse files
jdelvaretorvalds
authored andcommitted
.gitattributes: set git diff driver for C source code files
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. Link: http://lkml.kernel.org/r/20160907143403.1449324f@endymion Signed-off-by: Jean Delvare <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Joe Perches <[email protected]> Cc: Jonathan Corbet <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent ea03623 commit 218dd85

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.c diff=cpp
2+
*.h diff=cpp

0 commit comments

Comments
 (0)