Thread (30 messages) flat view 30 messages, 7 authors, 2021-10-25

Re: [PATCH 3/4] gitfaq: give advice on using eol attribute in gitattributes

From: Johannes Schindelin <hidden>
Date: 2021-10-21 12:03:13

Hi brian,

On Wed, 20 Oct 2021, brian m. carlson wrote:
On 2021-10-20 at 12:02:02, Johannes Schindelin wrote:
quoted
Hi brian,

On Wed, 20 Oct 2021, brian m. carlson wrote:
quoted
On 2021-10-20 at 01:21:40, Eric Sunshine wrote:
quoted
On Tue, Oct 19, 2021 at 9:06 PM brian m. carlson
[off-list ref] wrote:
quoted
diff --git a/Documentation/gitfaq.txt b/Documentation/gitfaq.txt
@@ -464,14 +465,25 @@ references, URLs, and hashes stored in the repository.
+With text files, Git will generally the repository contains LF endings in the
+repository, and will honor `core.autocrlf` and `core.eol` to decide what options
+to use when checking files out.  You can also override this by specifying a
+particular line ending such as `eol=lf` or `eol=crlf` if those files must always
+have that ending (e.g., for functionality reasons).
The first sentence in the paragraph is unparseable.
Yes, I think perhaps I omitted the word "ensure".

And I should reflect that they should have that ending in the working
tree, which I neglected to mention.
Please note that Git for Windows defaults to `core.autoCRLF=true`,
therefore this sentence is not completely correct. Maybe something as
short as "(except in Git for Windows, which defaults to CRLF endings)"
would suffice?
What I meant by that sentence was that I should add, "in the working
tree" to the sentence ending "if those files must always have that
ending".  I believe that is still the case for Git for Windows, since
otherwise our shell files in the repository would be broken there, and
I'm fairly confident they are not.
I swear I read this sentence multiple times yesterday, and still managed
to miss that you were talking about LF endings _in the repository_.

FWIW I think that `core.autoCRLF` defaults to `off` everywhere but on
Windows, so _technically_ Git would not ensure LF endings e.g. on Linux.
In practice, it is highly unlikely that a Linux user would generate text
files with CR/LF endings, so it would not matter in practice.

I feel a bit bad for arguing subtleties that realistically won't matter,
so please feel free to leave the sentence as you have intended it.

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help