Skip to content

Commit

Permalink
.gitattributes: set file type for C files
Browse files Browse the repository at this point in the history
Set the diff attribute for C source file to "cpp" in order to improve
git's ability to determine hunk headers.  In particular it helps avoid
showing unindented labels in hunk headers.  That in turn is useful for
git diff -W and git grep -W, which show whole functions now instead of
stopping at a label.

Signed-off-by: Rene Scharfe <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
rscharfe authored and gitster committed Jul 7, 2016
1 parent 674d38f commit e82675a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
* whitespace=!indent,trail,space
*.[ch] whitespace=indent,trail,space
*.[ch] whitespace=indent,trail,space diff=cpp
*.sh whitespace=indent,trail,space

0 comments on commit e82675a

Please sign in to comment.