Skip to content

Commit

Permalink
.gitattributes: CR at the end of the line is an error
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
Nanako Shiraishi authored and gitster committed Jun 21, 2009
1 parent c6720cf commit e2f6331
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,2 +1,2 @@
* whitespace=!indent,trail,space
*.[ch] whitespace
*.[ch] whitespace=indent,trail,space

0 comments on commit e2f6331

Please sign in to comment.