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

Re: [PATCH] .gitattributes: include `text` attribute for eol attributes

From
Philip Oakley <philipoakley@iee.email>
Date
Feb 3, 2023, 16:43 UTC
Message-ID
<43d807f1-07f0-c0a1-e6ae-bdb5df73a565@iee.email>
In-Reply-To
<230203.86k00yc167.gmgdl@evledraar.gmail.com>
On 03/02/2023 13:40, Ævar Arnfjörð Bjarmason wrote:
Show 22 quoted lines
> On Fri, Feb 03 2023, Philip Oakley wrote:
>
>> The standard advice for text file eol endings in the .gitattributes file
>> was updated in e28eae3184 (gitattributes: Document the unified "auto"
>> handling, 2016-08-26) with a recent clarification in 8c591dbfce (docs:
>> correct documentation about eol attribute, 2022-01-11), with a follow
>> up comment by the original author in [1] confirming the use of the eol
>> attribute in conjunction with the text attribute.
>>
>> Update Git's .gitattributes file to reflect our own advice.
>>
>> [1] https://lore.kernel.org/git/?q=%3C20220216115239.uo2ie3flaqo3nf2d%40tb-raspi4%3E.
>>
>> Signed-off-by: Philip Oakley <philipoakley@iee.email>
>> ---
>>
>> I was catching up on last year's back emails, and had saved those on
>> eol and text conversion, and was prompted by Torsten's [1] to check
>> my .gitattribute files, only to discover, we aren't providing a good
>> example to others. Let's fix that. 
> This seems sensible, but if we're taking the churn of changing these
> lines maybe it's worth moving or adjusting some of this while-at-it.

Seems reasonable. I've added in dscho (cc) for consideration of the Git for Windows viewpoint..

Show 23 quoted lines
>
> In particular:
>
>>  .gitattributes | 22 +++++++++++-----------
>>  1 file changed, 11 insertions(+), 11 deletions(-)
>>
>> diff --git a/.gitattributes b/.gitattributes
>> index b0044cf272..158c3d45c4 100644
>> --- a/.gitattributes
>> +++ b/.gitattributes
>> @@ -1,17 +1,17 @@
>>  * whitespace=!indent,trail,space
>>  *.[ch] whitespace=indent,trail,space diff=cpp
>> -*.sh whitespace=indent,trail,space eol=lf
>> -*.perl eol=lf diff=perl
>> -*.pl eof=lf diff=perl
>> -*.pm eol=lf diff=perl
>> -*.py eol=lf diff=python
>> -*.bat eol=crlf
> We don't have any *.bat in-tree except in compat/vcbuild/. Shouldn't we
> just create a compat/vcbuild/.gitattributes? This was added in
> https://lore.kernel.org/git/pull.149.v2.git.gitgitgadget@gmail.com/; so
> it's for those specific files.
sensible
>>  CODE_OF_CONDUCT.md -whitespace
Maybe the CODE_OF_CONDUCT.md should also be marked as text?
Show 8 quoted lines
>> -/Documentation/**/*.txt eol=lf
>> -/command-list.txt eol=lf
>> -/GIT-VERSION-GEN eol=lf
>> -/mergetools/* eol=lf
>> -/t/oid-info/* eol=lf
>> +/Documentation/**/*.txt text eol=lf
> We have a Documentation/.gitattributes, shouldn't we move this
> Documentation/ rule there instead?
ok
Show 5 quoted lines
>
>> +/command-list.txt text eol=lf
>> +/GIT-VERSION-GEN text eol=lf
>> +/mergetools/* text eol=lf
> ..maybe we should create a mergetools/.gitattributes & move this there?
perhaps. There are probably sufficient listed there to make it work it.
Show 7 quoted lines
>
>> +/t/oid-info/* text eol=lf
> Ditto t/.gitattributes and this t/oid-info/ rule.
>
>>  /Documentation/git-merge.txt conflict-marker-size=32
>>  /Documentation/gitk.txt conflict-marker-size=32
>>  /Documentation/user-manual.txt conflict-marker-size=32
I'll hold a day or so for any extra contributions.
Philip
Previous: Ævar Arnfjörð BjarmasonNext: Torsten Bögershausen
Message 21 of 24 in “Improvements to tests and docs for .gitattributes eol”
  1. 0/2 Improvements to tests and docs for .gitattributes eolbrian m. carlson, Jan 11, 2022
  2. 1/2 t0027: add tests for eol without text in .gitattributesbrian m. carlson, Jan 11, 2022
  3. 2/2 docs: correct documentation about eol attributebrian m. carlson, Jan 11, 2022
  4. Torsten B��gershausenJan 11, 2022
  5. brian m. carlsonJan 11, 2022
  6. Torsten B��gershausenJan 12, 2022
  7. 0/2 Improvements to tests and docs for .gitattributes eolbrian m. carlson, Feb 14, 2022
  8. 2/2 docs: correct documentation about eol attributebrian m. carlson, Feb 14, 2022
  9. 1/2 t0027: add tests for eol without text in .gitattributesbrian m. carlson, Feb 14, 2022
  10. Derrick StoleeFeb 14, 2022
  11. Junio C HamanoFeb 14, 2022
  12. Torsten B��gershausenFeb 14, 2022
  13. Junio C HamanoFeb 15, 2022
  14. Johannes SixtFeb 15, 2022
  15. brian m. carlsonFeb 15, 2022
  16. Johannes SixtFeb 16, 2022
  17. brian m. carlsonFeb 16, 2022
  18. Torsten B��gershausenFeb 16, 2022
  19. .gitattributes: include `text` attribute for eol attributesPhilip Oakley, Feb 3, 2023
  20. Ævar Arnfjörð BjarmasonFeb 3, 2023
  21. Philip OakleyFeb 3, 2023
  22. Torsten BögershausenFeb 4, 2023
  23. Junio C HamanoFeb 6, 2023
  24. Johannes SixtFeb 16, 2022

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.