Skip to content

Commit 8c591db

Browse files
bk2204gitster
authored andcommitted
docs: correct documentation about eol attribute
The documentation for the eol attribute states that it is "effectively setting the text attribute". However, this implies that it forces the text attribute to always be set, which has not been the case since 6523728 ("convert: unify the "auto" handling of CRLF", 2016-06-28). Let's avoid confusing users (and the present author when trying to describe Git's behavior to others) by clearly documenting in which cases the "eol" attribute has effect. Specifically, the attribute always has an effect unless the file is explicitly set as -text, or the file is set as text=auto and the file is detected as binary. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ab96151 commit 8c591db

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Documentation/gitattributes.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,12 @@ unspecified.
160160
^^^^^
161161

162162
This attribute sets a specific line-ending style to be used in the
163-
working directory. It enables end-of-line conversion without any
164-
content checks, effectively setting the `text` attribute. Note that
165-
setting this attribute on paths which are in the index with CRLF line
166-
endings may make the paths to be considered dirty. Adding the path to
167-
the index again will normalize the line endings in the index.
163+
working directory. This attribute has effect only if the `text`
164+
attribute is set or unspecified, or if it is set to `auto` and the file
165+
is detected as text. Note that setting this attribute on paths which
166+
are in the index with CRLF line endings may make the paths to be
167+
considered dirty. Adding the path to the index again will normalize the
168+
line endings in the index.
168169

169170
Set to string value "crlf"::
170171

0 commit comments

Comments
 (0)