Skip to content

Commit e82675a

Browse files
rscharfegitster
authored andcommitted
.gitattributes: set file type for C files
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]>
1 parent 674d38f commit e82675a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
* whitespace=!indent,trail,space
2-
*.[ch] whitespace=indent,trail,space
2+
*.[ch] whitespace=indent,trail,space diff=cpp
33
*.sh whitespace=indent,trail,space

0 commit comments

Comments
 (0)