git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Torsten =?unknown-8bit?Q?B=C3=B6gershausen?= <tboegi@web.de>
To: "brian m. carlson" <sandals@crustytoothpaste.net>,
	Johannes Sixt <j6t@kdbg.org>,
	git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v2 0/2] Improvements to tests and docs for .gitattributes eol
Date: Wed, 16 Feb 2022 12:52:39 +0100	[thread overview]
Message-ID: <20220216115239.uo2ie3flaqo3nf2d@tb-raspi4> (raw)
In-Reply-To: <YgzRyKZwsPw6rTyT@camp.crustytoothpaste.net>

On Wed, Feb 16, 2022 at 10:28:24AM +0000, brian m. carlson wrote:
> On 2022-02-16 at 07:00:24, Johannes Sixt wrote:
> > Just so you know where my confusion arises from: Your updated text has
> > the structure (as I read it)
> >
> >    if ... set or unspecified or if auto then ... detected ... and LF
> >
> > It is unclear whether the 'then' conditions apply only to 'if auto'.
> > Even if the additional 'if' in the middle makes me think that the
> > 'then's apply only to the 'auto' case, it is sufficently vage because in
> > my mental model there is not much difference between an 'unset' and a
> > set-to-'auto' attribute, and I wonder why the 'then's should not apply
> > to the 'unset' case as well.
> >
> > Moreover, after re-reading the text, I notice that text may be read as
> > "this attribute has an effect only if <conditions>" where <conditions>
> > basically means "always except for when the 'if auto' case is not met",
> > right? Would it perhaps be better to write "has no effect if <very
> > specific condition>"?
>
> The situation is that eol is in effect if and only if:

Well written

>
> * text is set;
> * text is unspecified; or
> * text is auto, the file is detected as text, and the file has LF line
>   endings in the index.
>
> Alternately, it has no effect if and only if:
>
> * text is unset;
> * text is auto and the file is detected as binary; or
> * text is auto and the file is detected as text and has CRLF line
>   endings.
... CRLF line endings in the index.
                      ^^^^^^^^^^^^

One of the reasons that the eol attribute is not 100% well-specified
is that people should use the eol attribute together with text.

Either
text=auto eol=crlf
or
text=auto eol=lf
or
text eol=crlf
or
text eol=lf

Older git versions did treat
* text=auto
* eol=crlf

The same as
* text eol=crlf
Which did corrupt binary files.

Never git versions treat
* text=auto
* eol=crlf
as
* text=auto eol=crlf
in the sense that only auto-detected text files are converted,
if they had not been commited with crlf before.

In that sense I feel that the short form
eol=crlf
should be avoided

>
> I'm not sure one reads significantly easier than the other.  I slightly
> prefer the former because it has fewer conditions with multiple nested
> entries, though.
> --
> brian m. carlson (he/him or they/them)
> Toronto, Ontario, CA



  reply	other threads:[~2022-02-16 11:53 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11  2:15 [PATCH 0/2] Improvements to tests and docs for .gitattributes eol brian m. carlson
2022-01-11  2:15 ` [PATCH 1/2] t0027: add tests for eol without text in .gitattributes brian m. carlson
2022-01-11  2:15 ` [PATCH 2/2] docs: correct documentation about eol attribute brian m. carlson
2022-01-11 18:30   ` Torsten =?unknown-8bit?Q?B=C3=B6gershausen?=
2022-01-11 22:40     ` brian m. carlson
2022-01-12 15:16       ` Torsten =?unknown-8bit?Q?B=C3=B6gershausen?=
2022-02-14  2:08 ` [PATCH v2 0/2] Improvements to tests and docs for .gitattributes eol brian m. carlson
2022-02-14  2:08   ` [PATCH v2 1/2] t0027: add tests for eol without text in .gitattributes brian m. carlson
2022-02-14  2:08   ` [PATCH v2 2/2] docs: correct documentation about eol attribute brian m. carlson
2022-02-14 14:52   ` [PATCH v2 0/2] Improvements to tests and docs for .gitattributes eol Derrick Stolee
2022-02-14 18:15   ` Junio C Hamano
2022-02-14 20:46     ` Torsten =?unknown-8bit?Q?B=C3=B6gershausen?=
2022-02-15  0:15       ` Junio C Hamano
2022-02-15  7:05         ` Johannes Sixt
2022-02-15 22:46           ` brian m. carlson
2022-02-16  7:00             ` Johannes Sixt
2022-02-16 10:28               ` brian m. carlson
2022-02-16 11:52                 ` Torsten =?unknown-8bit?Q?B=C3=B6gershausen?= [this message]
2023-02-03 12:59                   ` [PATCH] .gitattributes: include `text` attribute for eol attributes Philip Oakley
2023-02-03 13:40                     ` Ævar Arnfjörð Bjarmason
2023-02-03 16:43                       ` Philip Oakley
2023-02-04  8:03                     ` Torsten Bögershausen
2023-02-06 21:56                     ` Junio C Hamano
2022-02-16 19:02                 ` [PATCH v2 0/2] Improvements to tests and docs for .gitattributes eol Johannes Sixt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220216115239.uo2ie3flaqo3nf2d@tb-raspi4 \
    --to=tboegi@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).