Skip to content

Commit

Permalink
.gitattributes: set git diff driver for C source code files
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jdelvare authored and torvalds committed Oct 8, 2016
1 parent ea03623 commit 218dd85
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.c diff=cpp
*.h diff=cpp

0 comments on commit 218dd85

Please sign in to comment.