git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: <git@vger.kernel.org>
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Torsten Bögershausen" <tboegi@web.de>
Subject: [PATCH v2 1/2] t0027: add tests for eol without text in .gitattributes
Date: Mon, 14 Feb 2022 02:08:26 +0000	[thread overview]
Message-ID: <20220214020827.1508706-2-sandals@crustytoothpaste.net> (raw)
In-Reply-To: <20220214020827.1508706-1-sandals@crustytoothpaste.net>

Right now, it isn't clear what the behavior is when the eol attribute is
set in .gitattributes but the text attribute is not.  Let's add some
tests to document this behavior in our code, which happens to be that
the behavior is as if we set the text attribute implicitly.  This will
make sure we don't accidentally change the behavior, which somebody is
probably relying on, and serve as documentation to developers.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
---
 t/t0027-auto-crlf.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh
index 4a5c5c602c..c5f7ac63b0 100755
--- a/t/t0027-auto-crlf.sh
+++ b/t/t0027-auto-crlf.sh
@@ -597,6 +597,12 @@ do
 	# auto: core.autocrlf=false and core.eol unset(or native) uses native eol
 	checkout_files     auto  "$id" ""     false   ""       $NL   CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul
 	checkout_files     auto  "$id" ""     false   native   $NL   CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul
+	# core.autocrlf false, .gitattributes sets eol
+	checkout_files     ""    "$id" "lf"   false   ""       LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul
+	checkout_files     ""    "$id" "crlf" false   ""       CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul
+	# core.autocrlf true, .gitattributes sets eol
+	checkout_files     ""    "$id" "lf"   true    ""       LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul
+	checkout_files     ""    "$id" "crlf" true    ""       CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul
 done
 
 # The rest of the tests are unique; do the usual linting.

  reply	other threads:[~2022-02-14  2:09 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   ` brian m. carlson [this message]
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?=
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=20220214020827.1508706-2-sandals@crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=tboegi@web.de \
    /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).