OSDN Git Service

.gitattributes: set file type for C files
authorRené Scharfe <l.s.r@web.de>
Thu, 7 Jul 2016 20:11:50 +0000 (22:11 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 7 Jul 2016 21:11:15 +0000 (14:11 -0700)
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 <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
.gitattributes

index 5e98806..320e33c 100644 (file)
@@ -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