summaryrefslogtreecommitdiff
path: root/.gitattributes
AgeCommit message (Collapse)Author
2016-07-07.gitattributes: set file type for C filesRené Scharfe
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>
2010-01-06.gitattributes: detect 8-space indent in shell scriptsJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-21.gitattributes: CR at the end of the line is an errorNanako Shiraishi
When a CR is accidentally added at the end of a C source file in the git project tree, "git diff --check" doesn't detect it as an error. $ echo abQ | tr Q '\015' >>fast-import.c $ git diff --check I think this is because the "whitespace" attribute is set to *.[ch] files without specifying what kind of errors are caught. It makes git "notice all types of errors" (as described in the documentation), but I think it is incorrectly setting cr-at-eol, too, and hides this error. Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-11Define the project whitespace policyJunio C Hamano
This establishes what the "bad" whitespaces are for this project. The rules are: - Unless otherwise specified, indent with SP that could be replaced with HT are not "bad". But SP before HT in the indent is "bad", and trailing whitespaces are "bad". - For C source files, initial indent by SP that can be replaced with HT is also "bad". - Test scripts in t/ and test vectors in its subdirectories can contain anything, so we make it unrestricted for now. Anything "bad" will be shown in WHITESPACE error indicator in diff output, and "apply --whitespace=warn" will warn about it. Signed-off-by: Junio C Hamano <gitster@pobox.com>