2008-02-11 11:34:34 +08:00
|
|
|
* whitespace=!indent,trail,space
|
2016-07-08 04:11:50 +08:00
|
|
|
*.[ch] whitespace=indent,trail,space diff=cpp
|
Fix build with core.autocrlf=true
On Windows, the default line endings are denoted by a Carriage Return
byte followed by a Line Feed byte, while Linux and MacOSX use a single
Line Feed byte to denote a line ending.
To help with this situation, Git introduced several mechanisms over the
last decade, most prominently the `core.autocrlf` setting.
Sometimes, however, a single setting is incorrect, e.g. when certain
files in the source code are to be consumed by software that can handle
only LF line endings, while other files can use whatever is appropriate
for the current platform.
To allow for that, Git added the `eol` option to its .gitattributes
handling, expecting every user of Git to mark their source code
appropriately.
Bash assumes that line-endings of scripts are denoted by a single Line
Feed byte. Therefore, shell scripts in Git's source code are one example
where that `eol=lf` option is *required*.
When generating common-cmds.h, the Unix tools we use generally operate on
the assumption that input and output deliminate their lines using LF-only
line endings. Consequently, they would happily copy the CR byte verbatim
into the strings in common-cmds.h, which in turn makes the C preprocessor
barf (that interprets them as MacOS-style line endings). Therefore, we
have to mark the input files as LF-only: command-list.txt and
Documentation/git-*.txt.
Quite a bit belatedly, this patch brings Git's own source code in line
with those expectations by setting those attributes to allow for a
correct build even when core.autocrlf=true.
This patch can be validated even on Linux, by using this cadence:
git config core.autocrlf true
rm .git/index && git stash
make -j15 DEVELOPER=1
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-09 20:53:21 +08:00
|
|
|
*.sh whitespace=indent,trail,space eol=lf
|
2018-04-26 15:50:57 +08:00
|
|
|
*.perl eol=lf diff=perl
|
|
|
|
*.pl eof=lf diff=perl
|
|
|
|
*.pm eol=lf diff=perl
|
2018-04-26 15:50:58 +08:00
|
|
|
*.py eol=lf diff=python
|
2018-11-11 02:23:23 +08:00
|
|
|
/Documentation/**/*.txt eol=lf
|
Fix build with core.autocrlf=true
On Windows, the default line endings are denoted by a Carriage Return
byte followed by a Line Feed byte, while Linux and MacOSX use a single
Line Feed byte to denote a line ending.
To help with this situation, Git introduced several mechanisms over the
last decade, most prominently the `core.autocrlf` setting.
Sometimes, however, a single setting is incorrect, e.g. when certain
files in the source code are to be consumed by software that can handle
only LF line endings, while other files can use whatever is appropriate
for the current platform.
To allow for that, Git added the `eol` option to its .gitattributes
handling, expecting every user of Git to mark their source code
appropriately.
Bash assumes that line-endings of scripts are denoted by a single Line
Feed byte. Therefore, shell scripts in Git's source code are one example
where that `eol=lf` option is *required*.
When generating common-cmds.h, the Unix tools we use generally operate on
the assumption that input and output deliminate their lines using LF-only
line endings. Consequently, they would happily copy the CR byte verbatim
into the strings in common-cmds.h, which in turn makes the C preprocessor
barf (that interprets them as MacOS-style line endings). Therefore, we
have to mark the input files as LF-only: command-list.txt and
Documentation/git-*.txt.
Quite a bit belatedly, this patch brings Git's own source code in line
with those expectations by setting those attributes to allow for a
correct build even when core.autocrlf=true.
This patch can be validated even on Linux, by using this cadence:
git config core.autocrlf true
rm .git/index && git stash
make -j15 DEVELOPER=1
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-09 20:53:21 +08:00
|
|
|
/command-list.txt eol=lf
|
|
|
|
/GIT-VERSION-GEN eol=lf
|
|
|
|
/mergetools/* eol=lf
|
2018-12-12 04:35:46 +08:00
|
|
|
/t/oid-info/* eol=lf
|
2018-08-29 06:05:50 +08:00
|
|
|
/Documentation/git-merge.txt conflict-marker-size=32
|
|
|
|
/Documentation/gitk.txt conflict-marker-size=32
|
|
|
|
/Documentation/user-manual.txt conflict-marker-size=32
|
|
|
|
/t/t????-*.sh conflict-marker-size=32
|