summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2016-07-07 20:11:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-07-07 21:11:15 (GMT)
commite82675a040d559c56be54255901138a979eeec21 (patch)
tree2f2ab434aa779105321e5fb8186e3adf1d6663c3
parent674d38f55b6d6b9f1cea8821f09670e07c1c7961 (diff)
downloadgit-e82675a040d559c56be54255901138a979eeec21.zip
git-e82675a040d559c56be54255901138a979eeec21.tar.gz
git-e82675a040d559c56be54255901138a979eeec21.tar.bz2
.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 <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--.gitattributes2
1 files changed, 1 insertions, 1 deletions
diff --git a/.gitattributes b/.gitattributes
index 5e98806..320e33c 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -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