git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Oct 20, 2021, 01:27 UTC
Message-ID
<YW9wgbN/b8NkVp4z@camp.crustytoothpaste.net>
In-Reply-To
<CAPig+cTn4fZtssPrn+z582E++Kdc2+z+=iNtp2kodR=QJVeycg@mail.gmail.com>
On 2021-10-20 at 01:21:40, Eric Sunshine wrote:
Show 30 quoted lines
> On Tue, Oct 19, 2021 at 9:06 PM brian m. carlson
> <sandals@crustytoothpaste.net> wrote:
> > In the FAQ, we tell people how to use the text attribute, but we fail to
> > explain what to do with the eol attribute.  As we ourselves have
> > noticed, most shell implementations do not care for carriage returns,
> > and as such, people will practically always want them to use LF endings.
> > Similar things can be said for batch files on Windows, except with CRLF
> > endings.
> >
> > Since these are common things to have in a repository, let's help users
> > make a good decision by recommending that they use the gitattributes
> > file to correctly check out the endings.
> >
> > In addition, let's correct the cross-reference to this question, which
> > originally referred to "the following entry", even though a new entry
> > has been inserted in between.  The cross-reference notation should
> > prevent this from occurring and provide a link in formats, such as HTML,
> > which support that.
> >
> > Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
> > ---
> > 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.

Show 6 quoted lines
> > +# Ensure all shell files end up with LF endings and all batch files end up
> > +# with CRLF endings in the working tree and both end up with LF in the repo.
> > +*.sh text eol=lf
> > +*.bat text eol=crlf
> 
> Maybe: s/end up with/have/g
Great.  That does read more clearly and succinctly.
I'll include those fixes in a reroll.
-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
Previous: Eric SunshineNext: Johannes Schindelin
Message 4 of 30 in “Additional FAQ entries”
  1. 0/4 Additional FAQ entriesbrian m. carlson, Oct 20, 2021
  2. 3/4 gitfaq: give advice on using eol attribute in gitattributesbrian m. carlson, Oct 20, 2021
  3. Eric SunshineOct 20, 2021
  4. brian m. carlsonOct 20, 2021
  5. Johannes SchindelinOct 20, 2021
  6. brian m. carlsonOct 20, 2021
  7. Johannes SchindelinOct 21, 2021
  8. 4/4 doc: add a FAQ entry about syncing working treesbrian m. carlson, Oct 20, 2021
  9. Bagas SanjayaOct 20, 2021
  10. Philip OakleyOct 20, 2021
  11. Ævar Arnfjörð BjarmasonOct 20, 2021
  12. brian m. carlsonOct 21, 2021
  13. Ævar Arnfjörð BjarmasonOct 21, 2021
  14. 4/4 gitfaq: add entry about syncing working treesbrian m. carlson, Oct 20, 2021
  15. Eric SunshineOct 20, 2021
  16. brian m. carlsonOct 20, 2021
  17. Johannes SchindelinOct 20, 2021
  18. 1/4 gitfaq: add advice on monoreposbrian m. carlson, Oct 20, 2021
  19. Bagas SanjayaOct 20, 2021
  20. Ævar Arnfjörð BjarmasonOct 20, 2021
  21. brian m. carlsonOct 20, 2021
  22. Johannes SchindelinOct 20, 2021
  23. Philip OakleyOct 20, 2021
  24. brian m. carlsonOct 20, 2021
  25. Philip OakleyOct 25, 2021
  26. 2/4 gitfaq: add documentation on proxiesbrian m. carlson, Oct 20, 2021
  27. Johannes SchindelinOct 20, 2021
  28. brian m. carlsonOct 20, 2021
  29. Junio C HamanoOct 20, 2021
  30. brian m. carlsonOct 20, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.