{"thread":{"id":"40526","subject":"[PATCH] t0027: Improve test for not-normalized files","startedAt":"2015-10-09T02:58:42Z","lastAt":"2015-10-09T22:12:34Z","messageCount":2,"participants":["Torsten Bögershausen","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"271377","messageId":"56172D62.9060408@web.de","threadId":"40526","inReplyTo":null,"subject":"[PATCH] t0027: Improve test for not-normalized files","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2015-10-09T02:58:42Z","receivedAt":"2015-10-09T02:58:42Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"When a text file with mixed line endings is commited into the repo,\nit is called \"not normalized\" (or NNO) in t0027.\nThe existing test case using repoMIX did not fully test all combinations:\n(Especially when core.autocrlf = true)\nFiles with NL are not converted at commit, but at checkout, so a warning\nNL->CRLF is given.\nFiles with CRLF are not converted at all (so no warning will be given),\nunless they are marked as \"text\" or \"auto\".\n\nRemove repoMIX introduced in commit 8eeab92f02, and replace it with\na combination of NNO tests.\n\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\n t/t0027-auto-crlf.sh | 191 ++++++++++++++++++++++++++++++++++++++++++---------\n 1 file changed, 157 insertions(+), 34 deletions(-)\n\ndiff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh\nindex 1a56e5e..b343651 100755\n--- a/t/t0027-auto-crlf.sh\n+++ b/t/t0027-auto-crlf.sh\n@@ -55,6 +55,26 @@ create_gitattributes () {\n \tesac\n }\n +create_NNO_files () {\n+\tlfname=$1\n+\tcrlfname=$2\n+\tlfmixcrlf=$3\n+\tlfmixcr=$4\n+\tcrlfnul=$5\n+\tfor crlf in false true input\n+\tdo\n+\t\tfor attr in \"\" auto text -text lf crlf\n+\t\tdo\n+\t\t\tpfx=NNO_${crlf}_attr_${attr} &&\n+\t\t\tcp $lfname    ${pfx}_LF.txt &&\n+\t\t\tcp $crlfname  ${pfx}_CRLF.txt &&\n+\t\t\tcp $lfmixcrlf ${pfx}_CRLF_mix_LF.txt &&\n+\t\t\tcp $lfmixcr   ${pfx}_LF_mix_CR.txt &&\n+\t\t\tcp $crlfnul   ${pfx}_CRLF_nul.txt\n+\t\tdone\n+\tdone\n+}\n+\n check_warning () {\n \tcase \"$1\" in\n \tLF_CRLF) echo \"warning: LF will be replaced by CRLF\" >\"$2\".expect ;;\n@@ -62,7 +82,7 @@ check_warning () {\n \t'')\t                                                 >\"$2\".expect ;;\n \t*) echo >&2 \"Illegal 1\": \"$1\" ; return false ;;\n \tesac\n-\tgrep \"will be replaced by\" \"$2\" | sed -e \"s/\\(.*\\) in [^ ]*$/\\1/\" >\"$2\".actual\n+\tgrep \"will be replaced by\" \"$2\" | sed -e \"s/\\(.*\\) in [^ ]*$/\\1/\" | uniq\n>\"$2\".actual\n \ttest_cmp \"$2\".expect \"$2\".actual\n }\n @@ -71,19 +91,10 @@ commit_check_warn () {\n \tattr=$2\n \tlfname=$3\n \tcrlfname=$4\n-\trepoMIX=$5\n-\tlfmixcrlf=$6\n-\tlfmixcr=$7\n-\tcrlfnul=$8\n+\tlfmixcrlf=$5\n+\tlfmixcr=$6\n+\tcrlfnul=$7\n \tpfx=crlf_${crlf}_attr_${attr}\n-\t# Special handling for repoMIX: It should already be in the repo\n-\t# with CRLF\n-\tf=repoMIX\n-\tfname=${pfx}_$f.txt\n-\techo >.gitattributes &&\n-\tcp $f $fname &&\n-\tgit -c core.autocrlf=false add $fname 2>\"${pfx}_$f.err\" &&\n-\tgit commit -m \"repoMIX\" &&\n \tcreate_gitattributes \"$attr\" &&\n \tfor f in LF CRLF repoMIX LF_mix_CR CRLF_mix_LF LF_nul CRLF_nul\n \tdo\n@@ -99,6 +110,45 @@ commit_check_warn () {\n \tcheck_warning \"$crlfnul\" ${pfx}_CRLF_nul.err\n }\n +commit_chk_wrnNNO () {\n+\tcrlf=$1\n+\tattr=$2\n+\tlfwarn=$3\n+\tcrlfwarn=$4\n+\tlfmixcrlf=$5\n+\tlfmixcr=$6\n+\tcrlfnul=$7\n+\tpfx=NNO_${crlf}_attr_${attr}\n+\t#Commit files on top of existing file\n+\tcreate_gitattributes \"$attr\" &&\n+\tfor f in LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul\n+\tdo\n+\t\tfname=${pfx}_$f.txt &&\n+\t\tcp $f $fname &&\n+\t\tgit -c core.autocrlf=$crlf add $fname 2>/dev/null &&\n+\t\tgit -c core.autocrlf=$crlf commit -m \"commit_$fname\" $fname >\"${pfx}_$f.err\" 2>&1\n+\tdone\n+\n+\ttest_expect_success \"commit NNO files crlf=$crlf attr=$attr LF\" '\n+\t\tcheck_warning \"$lfwarn\" ${pfx}_LF.err\n+\t'\n+\ttest_expect_success \"commit NNO files crlf=$crlf attr=$attr CRLF\" '\n+\t\tcheck_warning \"$crlfwarn\" ${pfx}_CRLF.err\n+\t'\n+\n+\ttest_expect_success \"commit NNO files crlf=$crlf attr=$attr CRLF_mix_LF\" '\n+\t\tcheck_warning \"$lfmixcrlf\" ${pfx}_CRLF_mix_LF.err\n+\t'\n+\n+\ttest_expect_success \"commit NNO files crlf=$crlf attr=$attr LF_mix_cr\" '\n+\t\tcheck_warning \"$lfmixcr\" ${pfx}_LF_mix_CR.err\n+\t'\n+\n+\ttest_expect_success \"commit NNO files crlf=$crlf attr=$attr CRLF_nul\" '\n+\t\tcheck_warning \"$crlfnul\" ${pfx}_CRLF_nul.err\n+\t'\n+}\n+\n check_files_in_repo () {\n \tcrlf=$1\n \tattr=$2\n@@ -115,6 +165,31 @@ check_files_in_repo () {\n \tcompare_files $crlfnul ${pfx}CRLF_nul.txt\n }\n +check_in_repo_NNO () {\n+\tcrlf=$1\n+\tattr=$2\n+\tlfname=$3\n+\tcrlfname=$4\n+\tlfmixcrlf=$5\n+\tlfmixcr=$6\n+\tcrlfnul=$7\n+\tpfx=NNO_${crlf}_attr_${attr}_\n+\ttest_expect_success \"compare_files $lfname ${pfx}LF.txt\" '\n+\t\tcompare_files $lfname ${pfx}LF.txt\n+\t'\n+\ttest_expect_success \"compare_files $crlfname ${pfx}CRLF.txt\" '\n+\t\tcompare_files $crlfname ${pfx}CRLF.txt\n+\t'\n+\ttest_expect_success \"compare_files $lfmixcrlf ${pfx}CRLF_mix_LF.txt\" '\n+\t\tcompare_files $lfmixcrlf ${pfx}CRLF_mix_LF.txt\n+\t'\n+\ttest_expect_success \"compare_files $lfmixcr ${pfx}LF_mix_CR.txt\" '\n+\t\tcompare_files $lfmixcr ${pfx}LF_mix_CR.txt\n+\t'\n+\ttest_expect_success \"compare_files $crlfnul ${pfx}CRLF_nul.txt\" '\n+\t\tcompare_files $crlfnul ${pfx}CRLF_nul.txt\n+\t'\n+}\n  checkout_files () {\n \teol=$1\n@@ -169,7 +244,11 @@ test_expect_success 'setup master' '\n \tprintf \"line1\\nline2\\rline3\"     >LF_mix_CR &&\n \tprintf \"line1\\r\\nline2\\rline3\"   >CRLF_mix_CR &&\n \tprintf \"line1Q\\r\\nline2\\r\\nline3\" | q_to_nul >CRLF_nul &&\n-\tprintf \"line1Q\\nline2\\nline3\" | q_to_nul >LF_nul\n+\tprintf \"line1Q\\nline2\\nline3\" | q_to_nul >LF_nul &&\n+\tcreate_NNO_files CRLF_mix_LF CRLF_mix_LF CRLF_mix_LF CRLF_mix_LF CRLF_mix_LF &&\n+\tgit -c core.autocrlf=false add NNO_*.txt &&\n+\tgit commit -m \"mixed line endings\" &&\n+\ttest_tick\n '\n  @@ -191,46 +270,72 @@ else\n \tWAMIX=CRLF_LF\n fi\n -#                         attr   LF        CRLF      repoMIX   CRLFmixLF\nLFmixCR   CRLFNUL\n+#                         attr   LF        CRLF      CRLFmixLF LFmixCR   CRLFNUL\n test_expect_success 'commit files empty attr' '\n-\tcommit_check_warn false \"\"     \"\"        \"\"        \"\"        \"\"        \"\"\n   \"\" &&\n-\tcommit_check_warn true  \"\"     \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\"\n   \"\" &&\n-\tcommit_check_warn input \"\"     \"\"        \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\" \"\"\n   \"\"\n+\tcommit_check_warn false \"\"     \"\"        \"\"        \"\"        \"\"        \"\" &&\n+\tcommit_check_warn true  \"\"     \"LF_CRLF\" \"\"        \"LF_CRLF\" \"\"        \"\" &&\n+\tcommit_check_warn input \"\"     \"\"        \"CRLF_LF\" \"CRLF_LF\" \"\"        \"\"\n '\n  test_expect_success 'commit files attr=auto' '\n-\tcommit_check_warn false \"auto\" \"$WILC\"   \"$WICL\"   \"$WAMIX\"  \"$WAMIX\"  \"\"\n   \"\" &&\n-\tcommit_check_warn true  \"auto\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\"\n   \"\" &&\n-\tcommit_check_warn input \"auto\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\" \"\"\n   \"\"\n+\tcommit_check_warn false \"auto\" \"$WILC\"   \"$WICL\"   \"$WAMIX\"  \"\"        \"\" &&\n+\tcommit_check_warn true  \"auto\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"\"        \"\" &&\n+\tcommit_check_warn input \"auto\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \"\"        \"\"\n '\n  test_expect_success 'commit files attr=text' '\n-\tcommit_check_warn false \"text\" \"$WILC\"   \"$WICL\"   \"$WAMIX\"  \"$WAMIX\"  \"$WILC\"\n  \"$WICL\"   &&\n-\tcommit_check_warn true  \"text\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\"\n\"LF_CRLF\" \"\"        &&\n-\tcommit_check_warn input \"text\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\" \"\"\n   \"CRLF_LF\"\n+\tcommit_check_warn false \"text\" \"$WILC\"   \"$WICL\"   \"$WAMIX\"  \"$WILC\"   \"$WICL\"\n  &&\n+\tcommit_check_warn true  \"text\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\"\n   &&\n+\tcommit_check_warn input \"text\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \"\"        \"CRLF_LF\"\n '\n  test_expect_success 'commit files attr=-text' '\n-\tcommit_check_warn false \"-text\" \"\"       \"\"        \"\"        \"\"        \"\"\n   \"\" &&\n-\tcommit_check_warn true  \"-text\" \"\"       \"\"        \"\"        \"\"        \"\"\n   \"\" &&\n-\tcommit_check_warn input \"-text\" \"\"       \"\"        \"\"        \"\"        \"\"\n   \"\"\n+\tcommit_check_warn false \"-text\" \"\"       \"\"        \"\"        \"\"        \"\" &&\n+\tcommit_check_warn true  \"-text\" \"\"       \"\"        \"\"        \"\"        \"\" &&\n+\tcommit_check_warn input \"-text\" \"\"       \"\"        \"\"        \"\"        \"\"\n '\n  test_expect_success 'commit files attr=lf' '\n-\tcommit_check_warn false \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\"  \"\"\n   \"CRLF_LF\" &&\n-\tcommit_check_warn true  \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\"  \"\"\n   \"CRLF_LF\" &&\n-\tcommit_check_warn input \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\"  \"\"\n   \"CRLF_LF\"\n+\tcommit_check_warn false \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\"  \"\"\n\"CRLF_LF\" &&\n+\tcommit_check_warn true  \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\"  \"\"\n\"CRLF_LF\" &&\n+\tcommit_check_warn input \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\"  \"\"       \"CRLF_LF\"\n '\n  test_expect_success 'commit files attr=crlf' '\n-\tcommit_check_warn false \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\"\n\"LF_CRLF\" \"\" &&\n-\tcommit_check_warn true  \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\"\n\"LF_CRLF\" \"\" &&\n-\tcommit_check_warn input \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\"\n\"LF_CRLF\" \"\"\n+\tcommit_check_warn false \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\" &&\n+\tcommit_check_warn true  \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\" &&\n+\tcommit_check_warn input \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\"\n '\n +#                       attr   LF        CRLF      CRLFmixLF \t LF_mix_CR   CRLFNUL\n+commit_chk_wrnNNO false \"\"     \"\"        \"\"        \"\"        \t \"\"        \t \"\"\n+commit_chk_wrnNNO true  \"\"     \"LF_CRLF\" \"\"        \"\"        \t \"\"        \t \"\"\n+commit_chk_wrnNNO input \"\"     \"\"        \"\"        \"\"        \t \"\"        \t \"\"\n+\n+\n+commit_chk_wrnNNO false \"auto\" \"$WILC\"   \"$WICL\"   \"$WAMIX\"  \t \"\"        \t \"\"\n+commit_chk_wrnNNO true  \"auto\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \t \"\"        \t \"\"\n+commit_chk_wrnNNO input \"auto\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \t \"\"        \t \"\"\n+\n+commit_chk_wrnNNO false \"text\" \"$WILC\"   \"$WICL\"   \"$WAMIX\"  \t \"$WILC\"   \t \"$WICL\"\n+commit_chk_wrnNNO true  \"text\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \t \"LF_CRLF\" \t \"\"\n+commit_chk_wrnNNO input \"text\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \t \"\"        \t\n\"CRLF_LF\"\n+\n+commit_chk_wrnNNO false \"-text\" \"\"       \"\"        \"\"        \t \"\"        \t \"\"\n+commit_chk_wrnNNO true  \"-text\" \"\"       \"\"        \"\"        \t \"\"        \t \"\"\n+commit_chk_wrnNNO input \"-text\" \"\"       \"\"        \"\"        \t \"\"        \t \"\"\n+\n+commit_chk_wrnNNO false \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\" \t  \"\"       \t\n\"CRLF_LF\"\n+commit_chk_wrnNNO true  \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\" \t  \"\"       \t\n\"CRLF_LF\"\n+commit_chk_wrnNNO input \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\" \t  \"\"       \t\n\"CRLF_LF\"\n+\n+commit_chk_wrnNNO false \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \t \"LF_CRLF\" \t \"\"\n+commit_chk_wrnNNO true  \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \t \"LF_CRLF\" \t \"\"\n+commit_chk_wrnNNO input \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \t \"LF_CRLF\" \t \"\"\n+\n test_expect_success 'create files cleanup' '\n \trm -f *.txt &&\n-\tgit reset --hard\n+\tgit -c core.autocrlf=false reset --hard\n '\n  test_expect_success 'commit empty gitattribues' '\n@@ -257,6 +362,24 @@ test_expect_success 'commit -text' '\n \tcheck_files_in_repo input \"-text\" LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul\n '\n +#                       attr    LF        CRLF      CRLF_mix_LF  LF_mix_CR\nCRLFNUL\n+check_in_repo_NNO false \"\"      LF        CRLF      CRLF_mix_LF  LF_mix_CR\nCRLF_nul\n+check_in_repo_NNO true  \"\"      LF        CRLF      CRLF_mix_LF  LF_mix_CR\nCRLF_nul\n+check_in_repo_NNO input \"\"      LF        CRLF      CRLF_mix_LF  LF_mix_CR\nCRLF_nul\n+\n+check_in_repo_NNO false \"auto\"  LF        LF        LF           LF_mix_CR\nCRLF_nul\n+check_in_repo_NNO true  \"auto\"  LF        LF        LF           LF_mix_CR\nCRLF_nul\n+check_in_repo_NNO input \"auto\"  LF        LF        LF           LF_mix_CR\nCRLF_nul\n+\n+check_in_repo_NNO false \"text\"  LF        LF        LF           LF_mix_CR \tLF_nul\n+check_in_repo_NNO true  \"text\"  LF        LF        LF           LF_mix_CR \tLF_nul\n+check_in_repo_NNO input \"text\"  LF        LF        LF           LF_mix_CR \tLF_nul\n+\n+check_in_repo_NNO false \"-text\" LF        CRLF      CRLF_mix_LF  LF_mix_CR\nCRLF_nul\n+check_in_repo_NNO true  \"-text\" LF        CRLF      CRLF_mix_LF  LF_mix_CR\nCRLF_nul\n+check_in_repo_NNO input \"-text\" LF        CRLF      CRLF_mix_LF  LF_mix_CR\nCRLF_nul\n+\n+\n ################################################################################\n # Check how files in the repo are changed when they are checked out\n # How to read the table below:\n-- \n2.5.0\n"},{"id":"271392","messageId":"xmqqk2qvofn1.fsf@gitster.mtv.corp.google.com","threadId":"40526","inReplyTo":"56172D62.9060408@web.de","subject":"Re: [PATCH] t0027: Improve test for not-normalized files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-10-09T22:12:34Z","receivedAt":"2015-10-09T22:12:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\nThis patch is seriously broken and I do not know how you managed to\ndo so.  Notice how \"+create_NNO_files\" is indented but no other\nadded lines in the same hunk, for example.\n\nI tried to hand-munge, but gave up.\n\n>  +commit_chk_wrnNNO () {\n\nSquashing warn into wrn or (check into chk) does not make it any\neasier to read or type.\n\n> +\tcrlf=$1\n> +\tattr=$2\n> +\tlfwarn=$3\n> +\tcrlfwarn=$4\n> +\tlfmixcrlf=$5\n> +\tlfmixcr=$6\n> +\tcrlfnul=$7\n> +\tpfx=NNO_${crlf}_attr_${attr}\n> +\t#Commit files on top of existing file\n> +\tcreate_gitattributes \"$attr\" &&\n> +\tfor f in LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul\n> +\tdo\n> +\t\tfname=${pfx}_$f.txt &&\n> +\t\tcp $f $fname &&\n> +\t\tgit -c core.autocrlf=$crlf add $fname 2>/dev/null &&\n> +\t\tgit -c core.autocrlf=$crlf commit -m \"commit_$fname\" $fname >\"${pfx}_$f.err\" 2>&1\n> +\tdone\n> +\n> +\ttest_expect_success \"commit NNO files crlf=$crlf attr=$attr LF\" '\n> +\t\tcheck_warning \"$lfwarn\" ${pfx}_LF.err\n> +\t'\n> +\ttest_expect_success \"commit NNO files crlf=$crlf attr=$attr CRLF\" '\n> +\t\tcheck_warning \"$crlfwarn\" ${pfx}_CRLF.err\n> +\t'\n> +\n> +\ttest_expect_success \"commit NNO files crlf=$crlf attr=$attr CRLF_mix_LF\" '\n> +\t\tcheck_warning \"$lfmixcrlf\" ${pfx}_CRLF_mix_LF.err\n> +\t'\n> +\n> +\ttest_expect_success \"commit NNO files crlf=$crlf attr=$attr LF_mix_cr\" '\n> +\t\tcheck_warning \"$lfmixcr\" ${pfx}_LF_mix_CR.err\n> +\t'\n> +\n> +\ttest_expect_success \"commit NNO files crlf=$crlf attr=$attr CRLF_nul\" '\n> +\t\tcheck_warning \"$crlfnul\" ${pfx}_CRLF_nul.err\n> +\t'\n> +}\n> +\n>  check_files_in_repo () {\n>  \tcrlf=$1\n>  \tattr=$2\n> @@ -115,6 +165,31 @@ check_files_in_repo () {\n>  \tcompare_files $crlfnul ${pfx}CRLF_nul.txt\n>  }\n>  +check_in_repo_NNO () {\n> +\tcrlf=$1\n> +\tattr=$2\n> +\tlfname=$3\n> +\tcrlfname=$4\n> +\tlfmixcrlf=$5\n> +\tlfmixcr=$6\n> +\tcrlfnul=$7\n> +\tpfx=NNO_${crlf}_attr_${attr}_\n> +\ttest_expect_success \"compare_files $lfname ${pfx}LF.txt\" '\n> +\t\tcompare_files $lfname ${pfx}LF.txt\n> +\t'\n> +\ttest_expect_success \"compare_files $crlfname ${pfx}CRLF.txt\" '\n> +\t\tcompare_files $crlfname ${pfx}CRLF.txt\n> +\t'\n> +\ttest_expect_success \"compare_files $lfmixcrlf ${pfx}CRLF_mix_LF.txt\" '\n> +\t\tcompare_files $lfmixcrlf ${pfx}CRLF_mix_LF.txt\n> +\t'\n> +\ttest_expect_success \"compare_files $lfmixcr ${pfx}LF_mix_CR.txt\" '\n> +\t\tcompare_files $lfmixcr ${pfx}LF_mix_CR.txt\n> +\t'\n> +\ttest_expect_success \"compare_files $crlfnul ${pfx}CRLF_nul.txt\" '\n> +\t\tcompare_files $crlfnul ${pfx}CRLF_nul.txt\n> +\t'\n> +}\n>   checkout_files () {\n>  \teol=$1\n> @@ -169,7 +244,11 @@ test_expect_success 'setup master' '\n>  \tprintf \"line1\\nline2\\rline3\"     >LF_mix_CR &&\n>  \tprintf \"line1\\r\\nline2\\rline3\"   >CRLF_mix_CR &&\n>  \tprintf \"line1Q\\r\\nline2\\r\\nline3\" | q_to_nul >CRLF_nul &&\n> -\tprintf \"line1Q\\nline2\\nline3\" | q_to_nul >LF_nul\n> +\tprintf \"line1Q\\nline2\\nline3\" | q_to_nul >LF_nul &&\n> +\tcreate_NNO_files CRLF_mix_LF CRLF_mix_LF CRLF_mix_LF CRLF_mix_LF CRLF_mix_LF &&\n> +\tgit -c core.autocrlf=false add NNO_*.txt &&\n> +\tgit commit -m \"mixed line endings\" &&\n> +\ttest_tick\n>  '\n>   @@ -191,46 +270,72 @@ else\n>  \tWAMIX=CRLF_LF\n>  fi\n>  -#                         attr   LF        CRLF      repoMIX   CRLFmixLF\n> LFmixCR   CRLFNUL\n> +#                         attr   LF        CRLF      CRLFmixLF LFmixCR   CRLFNUL\n>  test_expect_success 'commit files empty attr' '\n> -\tcommit_check_warn false \"\"     \"\"        \"\"        \"\"        \"\"        \"\"\n>    \"\" &&\n> -\tcommit_check_warn true  \"\"     \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\"\n>    \"\" &&\n> -\tcommit_check_warn input \"\"     \"\"        \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\" \"\"\n>    \"\"\n> +\tcommit_check_warn false \"\"     \"\"        \"\"        \"\"        \"\"        \"\" &&\n> +\tcommit_check_warn true  \"\"     \"LF_CRLF\" \"\"        \"LF_CRLF\" \"\"        \"\" &&\n> +\tcommit_check_warn input \"\"     \"\"        \"CRLF_LF\" \"CRLF_LF\" \"\"        \"\"\n>  '\n>   test_expect_success 'commit files attr=auto' '\n> -\tcommit_check_warn false \"auto\" \"$WILC\"   \"$WICL\"   \"$WAMIX\"  \"$WAMIX\"  \"\"\n>    \"\" &&\n> -\tcommit_check_warn true  \"auto\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\"\n>    \"\" &&\n> -\tcommit_check_warn input \"auto\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\" \"\"\n>    \"\"\n> +\tcommit_check_warn false \"auto\" \"$WILC\"   \"$WICL\"   \"$WAMIX\"  \"\"        \"\" &&\n> +\tcommit_check_warn true  \"auto\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"\"        \"\" &&\n> +\tcommit_check_warn input \"auto\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \"\"        \"\"\n>  '\n>   test_expect_success 'commit files attr=text' '\n> -\tcommit_check_warn false \"text\" \"$WILC\"   \"$WICL\"   \"$WAMIX\"  \"$WAMIX\"  \"$WILC\"\n>   \"$WICL\"   &&\n> -\tcommit_check_warn true  \"text\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\"\n> \"LF_CRLF\" \"\"        &&\n> -\tcommit_check_warn input \"text\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\" \"\"\n>    \"CRLF_LF\"\n> +\tcommit_check_warn false \"text\" \"$WILC\"   \"$WICL\"   \"$WAMIX\"  \"$WILC\"   \"$WICL\"\n>   &&\n> +\tcommit_check_warn true  \"text\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\"\n>    &&\n> +\tcommit_check_warn input \"text\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \"\"        \"CRLF_LF\"\n>  '\n>   test_expect_success 'commit files attr=-text' '\n> -\tcommit_check_warn false \"-text\" \"\"       \"\"        \"\"        \"\"        \"\"\n>    \"\" &&\n> -\tcommit_check_warn true  \"-text\" \"\"       \"\"        \"\"        \"\"        \"\"\n>    \"\" &&\n> -\tcommit_check_warn input \"-text\" \"\"       \"\"        \"\"        \"\"        \"\"\n>    \"\"\n> +\tcommit_check_warn false \"-text\" \"\"       \"\"        \"\"        \"\"        \"\" &&\n> +\tcommit_check_warn true  \"-text\" \"\"       \"\"        \"\"        \"\"        \"\" &&\n> +\tcommit_check_warn input \"-text\" \"\"       \"\"        \"\"        \"\"        \"\"\n>  '\n>   test_expect_success 'commit files attr=lf' '\n> -\tcommit_check_warn false \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\"  \"\"\n>    \"CRLF_LF\" &&\n> -\tcommit_check_warn true  \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\"  \"\"\n>    \"CRLF_LF\" &&\n> -\tcommit_check_warn input \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\"  \"\"\n>    \"CRLF_LF\"\n> +\tcommit_check_warn false \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\"  \"\"\n> \"CRLF_LF\" &&\n> +\tcommit_check_warn true  \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\"  \"\"\n> \"CRLF_LF\" &&\n> +\tcommit_check_warn input \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\"  \"\"       \"CRLF_LF\"\n>  '\n>   test_expect_success 'commit files attr=crlf' '\n> -\tcommit_check_warn false \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\"\n> \"LF_CRLF\" \"\" &&\n> -\tcommit_check_warn true  \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\"\n> \"LF_CRLF\" \"\" &&\n> -\tcommit_check_warn input \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\"\n> \"LF_CRLF\" \"\"\n> +\tcommit_check_warn false \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\" &&\n> +\tcommit_check_warn true  \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\" &&\n> +\tcommit_check_warn input \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\"\n>  '\n>  +#                       attr   LF        CRLF      CRLFmixLF \t LF_mix_CR   CRLFNUL\n> +commit_chk_wrnNNO false \"\"     \"\"        \"\"        \"\"        \t \"\"        \t \"\"\n> +commit_chk_wrnNNO true  \"\"     \"LF_CRLF\" \"\"        \"\"        \t \"\"        \t \"\"\n> +commit_chk_wrnNNO input \"\"     \"\"        \"\"        \"\"        \t \"\"        \t \"\"\n> +\n> +\n> +commit_chk_wrnNNO false \"auto\" \"$WILC\"   \"$WICL\"   \"$WAMIX\"  \t \"\"        \t \"\"\n> +commit_chk_wrnNNO true  \"auto\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \t \"\"        \t \"\"\n> +commit_chk_wrnNNO input \"auto\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \t \"\"        \t \"\"\n> +\n> +commit_chk_wrnNNO false \"text\" \"$WILC\"   \"$WICL\"   \"$WAMIX\"  \t \"$WILC\"   \t \"$WICL\"\n> +commit_chk_wrnNNO true  \"text\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \t \"LF_CRLF\" \t \"\"\n> +commit_chk_wrnNNO input \"text\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \t \"\"        \t\n> \"CRLF_LF\"\n> +\n> +commit_chk_wrnNNO false \"-text\" \"\"       \"\"        \"\"        \t \"\"        \t \"\"\n> +commit_chk_wrnNNO true  \"-text\" \"\"       \"\"        \"\"        \t \"\"        \t \"\"\n> +commit_chk_wrnNNO input \"-text\" \"\"       \"\"        \"\"        \t \"\"        \t \"\"\n> +\n> +commit_chk_wrnNNO false \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\" \t  \"\"       \t\n> \"CRLF_LF\"\n> +commit_chk_wrnNNO true  \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\" \t  \"\"       \t\n> \"CRLF_LF\"\n> +commit_chk_wrnNNO input \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\" \t  \"\"       \t\n> \"CRLF_LF\"\n> +\n> +commit_chk_wrnNNO false \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \t \"LF_CRLF\" \t \"\"\n> +commit_chk_wrnNNO true  \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \t \"LF_CRLF\" \t \"\"\n> +commit_chk_wrnNNO input \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \t \"LF_CRLF\" \t \"\"\n> +\n>  test_expect_success 'create files cleanup' '\n>  \trm -f *.txt &&\n> -\tgit reset --hard\n> +\tgit -c core.autocrlf=false reset --hard\n>  '\n>   test_expect_success 'commit empty gitattribues' '\n> @@ -257,6 +362,24 @@ test_expect_success 'commit -text' '\n>  \tcheck_files_in_repo input \"-text\" LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul\n>  '\n>  +#                       attr    LF        CRLF      CRLF_mix_LF  LF_mix_CR\n> CRLFNUL\n> +check_in_repo_NNO false \"\"      LF        CRLF      CRLF_mix_LF  LF_mix_CR\n> CRLF_nul\n> +check_in_repo_NNO true  \"\"      LF        CRLF      CRLF_mix_LF  LF_mix_CR\n> CRLF_nul\n> +check_in_repo_NNO input \"\"      LF        CRLF      CRLF_mix_LF  LF_mix_CR\n> CRLF_nul\n> +\n> +check_in_repo_NNO false \"auto\"  LF        LF        LF           LF_mix_CR\n> CRLF_nul\n> +check_in_repo_NNO true  \"auto\"  LF        LF        LF           LF_mix_CR\n> CRLF_nul\n> +check_in_repo_NNO input \"auto\"  LF        LF        LF           LF_mix_CR\n> CRLF_nul\n> +\n> +check_in_repo_NNO false \"text\"  LF        LF        LF           LF_mix_CR \tLF_nul\n> +check_in_repo_NNO true  \"text\"  LF        LF        LF           LF_mix_CR \tLF_nul\n> +check_in_repo_NNO input \"text\"  LF        LF        LF           LF_mix_CR \tLF_nul\n> +\n> +check_in_repo_NNO false \"-text\" LF        CRLF      CRLF_mix_LF  LF_mix_CR\n> CRLF_nul\n> +check_in_repo_NNO true  \"-text\" LF        CRLF      CRLF_mix_LF  LF_mix_CR\n> CRLF_nul\n> +check_in_repo_NNO input \"-text\" LF        CRLF      CRLF_mix_LF  LF_mix_CR\n> CRLF_nul\n> +\n> +\n>  ################################################################################\n>  # Check how files in the repo are changed when they are checked out\n>  # How to read the table below:\n"}]}