{"thread":{"id":"39158","subject":"[PATCH v2] t0027: Add repoMIX and LF_nul","startedAt":"2015-04-25T06:47:13Z","lastAt":"2015-04-26T04:32:32Z","messageCount":5,"participants":["Torsten Bögershausen","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"259985","messageId":"553B3871.6050904@web.de","threadId":"39158","inReplyTo":null,"subject":"[PATCH v2] t0027: Add repoMIX and LF_nul","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2015-04-25T06:47:13Z","receivedAt":"2015-04-25T06:47:13Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"\"new safer autocrlf handling\":\n  Check if eols in a file are converted at commit, when the file has\n  CR (or CLLF) in the repo (technically speaking in the index).\n  Add a test-file repoMIX with mixed line-endings.\n  When converting LF->CRLF or CRLF->LF: check the warnings\n\ncheckout_files():\n  Checking out CRLF_nul and checking for eol coversion does not\n  make much sense (CRLF will stay CRLF).\n  Use the file LF_nul instead: It is handled a binary in \"auto\" modes,\n  and when declared as text the LF may be replaced with CRLF, depending\n  on the configuration\n\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\nChanges since V1:\nUse TAB for indentation at on place (Thanks Eric)\n t/t0027-auto-crlf.sh | 157 ++++++++++++++++++++++++++++-----------------------\n 1 file changed, 85 insertions(+), 72 deletions(-)\n\ndiff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh\nindex 810934b..1a56e5e 100755\n--- a/t/t0027-auto-crlf.sh\n+++ b/t/t0027-auto-crlf.sh\n@@ -71,12 +71,21 @@ commit_check_warn () {\n \tattr=$2\n \tlfname=$3\n \tcrlfname=$4\n-\tlfmixcrlf=$5\n-\tlfmixcr=$6\n-\tcrlfnul=$7\n-\tcreate_gitattributes \"$attr\" &&\n+\trepoMIX=$5\n+\tlfmixcrlf=$6\n+\tlfmixcr=$7\n+\tcrlfnul=$8\n \tpfx=crlf_${crlf}_attr_${attr}\n-\tfor f in LF CRLF LF_mix_CR CRLF_mix_LF CRLF_nul\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 \t\tfname=${pfx}_$f.txt &&\n \t\tcp $f $fname &&\n@@ -120,7 +129,7 @@ checkout_files () {\n \tgit config core.autocrlf $crlf &&\n \tpfx=eol_${eol}_crlf_${crlf}_attr_${attr}_ &&\n \tsrc=crlf_false_attr__ &&\n-\tfor f in LF CRLF LF_mix_CR CRLF_mix_LF CRLF_nul\n+\tfor f in LF CRLF LF_mix_CR CRLF_mix_LF LF_nul\n \tdo\n \t\trm $src$f.txt &&\n \t\tif test -z \"$eol\"; then\n@@ -142,8 +151,8 @@ checkout_files () {\n \ttest_expect_success \"checkout core.eol=$eol core.autocrlf=$crlf gitattributes=$attr file=LF_mix_CR\" \"\n \t\tcompare_ws_file $pfx $lfmixcr   ${src}LF_mix_CR.txt\n \t\"\n-\ttest_expect_success \"checkout core.eol=$eol core.autocrlf=$crlf gitattributes=$attr file=CRLF_nul\" \"\n-\t\tcompare_ws_file $pfx $crlfnul   ${src}CRLF_nul.txt\n+\ttest_expect_success \"checkout core.eol=$eol core.autocrlf=$crlf gitattributes=$attr file=LF_nul\" \"\n+\t\tcompare_ws_file $pfx $crlfnul   ${src}LF_nul.txt\n \t\"\n }\n \n@@ -155,6 +164,7 @@ test_expect_success 'setup master' '\n \tgit commit -m \"add .gitattributes\" \"\" &&\n \tprintf \"line1\\nline2\\nline3\"     >LF &&\n \tprintf \"line1\\r\\nline2\\r\\nline3\" >CRLF &&\n+\tprintf \"line1\\r\\nline2\\nline3\"   >repoMIX &&\n \tprintf \"line1\\r\\nline2\\nline3\"   >CRLF_mix_LF &&\n \tprintf \"line1\\nline2\\rline3\"     >LF_mix_CR &&\n \tprintf \"line1\\r\\nline2\\rline3\"   >CRLF_mix_CR &&\n@@ -181,40 +191,41 @@ else\n \tWAMIX=CRLF_LF\n fi\n \n+#                         attr   LF        CRLF      repoMIX   CRLFmixLF LFmixCR   CRLFNUL\n test_expect_success 'commit files empty attr' '\n-\tcommit_check_warn false \"\"     \"\"        \"\"        \"\"        \"\"        \"\" &&\n-\tcommit_check_warn true  \"\"     \"LF_CRLF\" \"\"        \"LF_CRLF\" \"\"        \"\" &&\n-\tcommit_check_warn input \"\"     \"\"        \"CRLF_LF\" \"CRLF_LF\" \"\"        \"\"\n+\tcommit_check_warn false \"\"     \"\"        \"\"        \"\"        \"\"        \"\"        \"\" &&\n+\tcommit_check_warn true  \"\"     \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\"        \"\" &&\n+\tcommit_check_warn input \"\"     \"\"        \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\" \"\"        \"\"\n '\n \n test_expect_success 'commit files attr=auto' '\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+\tcommit_check_warn false \"auto\" \"$WILC\"   \"$WICL\"   \"$WAMIX\"  \"$WAMIX\"  \"\"        \"\" &&\n+\tcommit_check_warn true  \"auto\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\"        \"\" &&\n+\tcommit_check_warn input \"auto\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\" \"\"        \"\"\n '\n \n test_expect_success 'commit files attr=text' '\n-\tcommit_check_warn false \"text\" \"$WILC\"  \"$WICL\"    \"$WAMIX\"  \"$WILC\"  \"$WICL\" &&\n-\tcommit_check_warn true  \"text\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\"        &&\n-\tcommit_check_warn input \"text\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \"\"        \"CRLF_LF\"\n+\tcommit_check_warn false \"text\" \"$WILC\"   \"$WICL\"   \"$WAMIX\"  \"$WAMIX\"  \"$WILC\"   \"$WICL\"   &&\n+\tcommit_check_warn true  \"text\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"LF_CRLF\" \"\"        &&\n+\tcommit_check_warn input \"text\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\" \"\"        \"CRLF_LF\"\n '\n \n test_expect_success 'commit files attr=-text' '\n-\tcommit_check_warn false \"-text\" \"\"       \"\"        \"\"        \"\"        \"\" &&\n-\tcommit_check_warn true  \"-text\" \"\"       \"\"        \"\"        \"\"        \"\" &&\n-\tcommit_check_warn input \"-text\" \"\"       \"\"        \"\"        \"\"        \"\"\n+\tcommit_check_warn false \"-text\" \"\"       \"\"        \"\"        \"\"        \"\"        \"\" &&\n+\tcommit_check_warn true  \"-text\" \"\"       \"\"        \"\"        \"\"        \"\"        \"\" &&\n+\tcommit_check_warn input \"-text\" \"\"       \"\"        \"\"        \"\"        \"\"        \"\"\n '\n \n test_expect_success 'commit files attr=lf' '\n-\tcommit_check_warn false \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\"  \"\"       \"CRLF_LF\" &&\n-\tcommit_check_warn true  \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\"  \"\"       \"CRLF_LF\" &&\n-\tcommit_check_warn input \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\"  \"\"       \"CRLF_LF\"\n+\tcommit_check_warn false \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\"  \"\"       \"CRLF_LF\" &&\n+\tcommit_check_warn true  \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\"  \"\"       \"CRLF_LF\" &&\n+\tcommit_check_warn input \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\"  \"\"       \"CRLF_LF\"\n '\n \n test_expect_success 'commit files attr=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+\tcommit_check_warn false \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"LF_CRLF\" \"\" &&\n+\tcommit_check_warn true  \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"LF_CRLF\" \"\" &&\n+\tcommit_check_warn input \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"LF_CRLF\" \"\"\n '\n \n test_expect_success 'create files cleanup' '\n@@ -268,79 +279,81 @@ test_expect_success 'commit -text' '\n #                    eol     acrlf\n #                                            ----------------------------------------------\n #                                            What we want to have in the working tree:\n-if test_have_prereq MINGW\n+if test_have_prereq NATIVE_CRLF\n then\n MIX_CRLF_LF=CRLF\n MIX_LF_CR=CRLF_mix_CR\n NL=CRLF\n+LFNUL=CRLF_nul\n else\n MIX_CRLF_LF=CRLF_mix_LF\n MIX_LF_CR=LF_mix_CR\n NL=LF\n+LFNUL=LF_nul\n fi\n export CRLF_MIX_LF_CR MIX NL\n \n-checkout_files    lf      false  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    lf      true   \"\"       CRLF  CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    lf      input  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    lf      false \"auto\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    lf      true  \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    CRLF_nul\n-checkout_files    lf      input \"auto\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    lf      false \"text\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n+checkout_files    lf      false  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    lf      true   \"\"       CRLF  CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    lf      input  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    lf      false \"auto\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    lf      true  \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    LF_nul\n+checkout_files    lf      input \"auto\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    lf      false \"text\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n checkout_files    lf      true  \"text\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n-checkout_files    lf      input \"text\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    lf      false \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    lf      true  \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    lf      input \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    lf      false \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    lf      true  \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    lf      input \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n+checkout_files    lf      input \"text\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    lf      false \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    lf      true  \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    lf      input \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    lf      false \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    lf      true  \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    lf      input \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n checkout_files    lf      false \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n checkout_files    lf      true  \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n checkout_files    lf      input \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n \n-checkout_files    crlf    false  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    crlf    true   \"\"       CRLF  CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    crlf    false \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    CRLF_nul\n-checkout_files    crlf    true  \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    CRLF_nul\n+checkout_files    crlf    false  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    crlf    true   \"\"       CRLF  CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    crlf    false \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    LF_nul\n+checkout_files    crlf    true  \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    LF_nul\n checkout_files    crlf    false \"text\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n checkout_files    crlf    true  \"text\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n-checkout_files    crlf    false \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    crlf    true  \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    crlf    false \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    crlf    true  \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n+checkout_files    crlf    false \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    crlf    true  \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    crlf    false \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    crlf    true  \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n checkout_files    crlf    false \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n checkout_files    crlf    true  \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n \n-checkout_files    \"\"      false  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    \"\"      true   \"\"       CRLF  CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    \"\"      input  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    \"\"      false \"auto\"    $NL   CRLF  $MIX_CRLF_LF LF_mix_CR    CRLF_nul\n-checkout_files    \"\"      true  \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    CRLF_nul\n-checkout_files    \"\"      input \"auto\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    \"\"      false \"text\"    $NL   CRLF  $MIX_CRLF_LF $MIX_LF_CR   CRLF_nul\n+checkout_files    \"\"      false  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    \"\"      true   \"\"       CRLF  CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    \"\"      input  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    \"\"      false \"auto\"    $NL   CRLF  $MIX_CRLF_LF LF_mix_CR    LF_nul\n+checkout_files    \"\"      true  \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    LF_nul\n+checkout_files    \"\"      input \"auto\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    \"\"      false \"text\"    $NL   CRLF  $MIX_CRLF_LF $MIX_LF_CR   $LFNUL\n checkout_files    \"\"      true  \"text\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n-checkout_files    \"\"      input \"text\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    \"\"      false \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    \"\"      true  \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    \"\"      input \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    \"\"      false \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    \"\"      true  \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    \"\"      input \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n+checkout_files    \"\"      input \"text\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    \"\"      false \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    \"\"      true  \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    \"\"      input \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    \"\"      false \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    \"\"      true  \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    \"\"      input \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n checkout_files    \"\"      false \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n checkout_files    \"\"      true  \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n checkout_files    \"\"      input \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n \n-checkout_files    native  false  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    native  true   \"\"       CRLF  CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    native  false \"auto\"    $NL   CRLF  $MIX_CRLF_LF LF_mix_CR    CRLF_nul\n-checkout_files    native  true  \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    CRLF_nul\n-checkout_files    native  false \"text\"    $NL   CRLF  $MIX_CRLF_LF $MIX_LF_CR   CRLF_nul\n+checkout_files    native  false  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    native  true   \"\"       CRLF  CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    native  false \"auto\"    $NL   CRLF  $MIX_CRLF_LF LF_mix_CR    LF_nul\n+checkout_files    native  true  \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    LF_nul\n+checkout_files    native  false \"text\"    $NL   CRLF  $MIX_CRLF_LF $MIX_LF_CR   $LFNUL\n checkout_files    native  true  \"text\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n-checkout_files    native  false \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    native  true  \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    native  false \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n-checkout_files    native  true  \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n+checkout_files    native  false \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    native  true  \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    native  false \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n+checkout_files    native  true  \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n checkout_files    native  false \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n checkout_files    native  true  \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n \n-- \n2.2.0.rc1.790.ge19fcd2\n"},{"id":"259994","messageId":"6d0ff6f2d14e9efe73a39715c26be402@www.dscho.org","threadId":"39158","inReplyTo":"553B3871.6050904@web.de","subject":"Re: [PATCH v2] t0027: Add repoMIX and LF_nul","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-04-25T15:13:19Z","receivedAt":"2015-04-25T15:13:19Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Torsten,\n\nOn 2015-04-25 08:47, Torsten Bögershausen wrote:\n> \"new safer autocrlf handling\":\n>   Check if eols in a file are converted at commit, when the file has\n>   CR (or CLLF) in the repo (technically speaking in the index).\n>   Add a test-file repoMIX with mixed line-endings.\n>   When converting LF->CRLF or CRLF->LF: check the warnings\n> \n> checkout_files():\n>   Checking out CRLF_nul and checking for eol coversion does not\n>   make much sense (CRLF will stay CRLF).\n>   Use the file LF_nul instead: It is handled a binary in \"auto\" modes,\n>   and when declared as text the LF may be replaced with CRLF, depending\n>   on the configuration\n\nWorks precisely as advertised on Windows (tested on top of Git for Windows 2.3.6 release 2).\n\n> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n\nFWIW Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nCiao,\nDscho\n"},{"id":"259997","messageId":"xmqqegn817pr.fsf@gitster.dls.corp.google.com","threadId":"39158","inReplyTo":"553B3871.6050904@web.de","subject":"Re: [PATCH v2] t0027: Add repoMIX and LF_nul","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-04-25T16:41:20Z","receivedAt":"2015-04-25T16:41:20Z","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\n> \"new safer autocrlf handling\":\n>   Check if eols in a file are converted at commit, when the file has\n>   CR (or CLLF) in the repo (technically speaking in the index).\n\ns/CLLF/CRLF/?  (no need to resend for this; I'll locally amend)\n\n>   Add a test-file repoMIX with mixed line-endings.\n>   When converting LF->CRLF or CRLF->LF: check the warnings\n>\n> checkout_files():\n>   Checking out CRLF_nul and checking for eol coversion does not\n>   make much sense (CRLF will stay CRLF).\n\nHmph, would it still make sense to make sure that CRLF will stay CRLF\nso that future changes to break this expectation can be caught?  Not\nthat such a breakage is likely...\n\n>   Use the file LF_nul instead: It is handled a binary in \"auto\" modes,\n>   and when declared as text the LF may be replaced with CRLF, depending\n>   on the configuration\n\nMakes sense.  Thanks.\n\n> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n> ---\n> Changes since V1:\n> Use TAB for indentation at on place (Thanks Eric)\n>  t/t0027-auto-crlf.sh | 157 ++++++++++++++++++++++++++++-----------------------\n>  1 file changed, 85 insertions(+), 72 deletions(-)\n>\n> diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh\n> index 810934b..1a56e5e 100755\n> --- a/t/t0027-auto-crlf.sh\n> +++ b/t/t0027-auto-crlf.sh\n> @@ -71,12 +71,21 @@ commit_check_warn () {\n>  \tattr=$2\n>  \tlfname=$3\n>  \tcrlfname=$4\n> -\tlfmixcrlf=$5\n> -\tlfmixcr=$6\n> -\tcrlfnul=$7\n> -\tcreate_gitattributes \"$attr\" &&\n> +\trepoMIX=$5\n> +\tlfmixcrlf=$6\n> +\tlfmixcr=$7\n> +\tcrlfnul=$8\n>  \tpfx=crlf_${crlf}_attr_${attr}\n> -\tfor f in LF CRLF LF_mix_CR CRLF_mix_LF CRLF_nul\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>  \t\tfname=${pfx}_$f.txt &&\n>  \t\tcp $f $fname &&\n> @@ -120,7 +129,7 @@ checkout_files () {\n>  \tgit config core.autocrlf $crlf &&\n>  \tpfx=eol_${eol}_crlf_${crlf}_attr_${attr}_ &&\n>  \tsrc=crlf_false_attr__ &&\n> -\tfor f in LF CRLF LF_mix_CR CRLF_mix_LF CRLF_nul\n> +\tfor f in LF CRLF LF_mix_CR CRLF_mix_LF LF_nul\n>  \tdo\n>  \t\trm $src$f.txt &&\n>  \t\tif test -z \"$eol\"; then\n> @@ -142,8 +151,8 @@ checkout_files () {\n>  \ttest_expect_success \"checkout core.eol=$eol core.autocrlf=$crlf gitattributes=$attr file=LF_mix_CR\" \"\n>  \t\tcompare_ws_file $pfx $lfmixcr   ${src}LF_mix_CR.txt\n>  \t\"\n> -\ttest_expect_success \"checkout core.eol=$eol core.autocrlf=$crlf gitattributes=$attr file=CRLF_nul\" \"\n> -\t\tcompare_ws_file $pfx $crlfnul   ${src}CRLF_nul.txt\n> +\ttest_expect_success \"checkout core.eol=$eol core.autocrlf=$crlf gitattributes=$attr file=LF_nul\" \"\n> +\t\tcompare_ws_file $pfx $crlfnul   ${src}LF_nul.txt\n>  \t\"\n>  }\n>  \n> @@ -155,6 +164,7 @@ test_expect_success 'setup master' '\n>  \tgit commit -m \"add .gitattributes\" \"\" &&\n>  \tprintf \"line1\\nline2\\nline3\"     >LF &&\n>  \tprintf \"line1\\r\\nline2\\r\\nline3\" >CRLF &&\n> +\tprintf \"line1\\r\\nline2\\nline3\"   >repoMIX &&\n>  \tprintf \"line1\\r\\nline2\\nline3\"   >CRLF_mix_LF &&\n>  \tprintf \"line1\\nline2\\rline3\"     >LF_mix_CR &&\n>  \tprintf \"line1\\r\\nline2\\rline3\"   >CRLF_mix_CR &&\n> @@ -181,40 +191,41 @@ else\n>  \tWAMIX=CRLF_LF\n>  fi\n>  \n> +#                         attr   LF        CRLF      repoMIX   CRLFmixLF LFmixCR   CRLFNUL\n>  test_expect_success 'commit files empty attr' '\n> -\tcommit_check_warn false \"\"     \"\"        \"\"        \"\"        \"\"        \"\" &&\n> -\tcommit_check_warn true  \"\"     \"LF_CRLF\" \"\"        \"LF_CRLF\" \"\"        \"\" &&\n> -\tcommit_check_warn input \"\"     \"\"        \"CRLF_LF\" \"CRLF_LF\" \"\"        \"\"\n> +\tcommit_check_warn false \"\"     \"\"        \"\"        \"\"        \"\"        \"\"        \"\" &&\n> +\tcommit_check_warn true  \"\"     \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\"        \"\" &&\n> +\tcommit_check_warn input \"\"     \"\"        \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\" \"\"        \"\"\n>  '\n>  \n>  test_expect_success 'commit files attr=auto' '\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> +\tcommit_check_warn false \"auto\" \"$WILC\"   \"$WICL\"   \"$WAMIX\"  \"$WAMIX\"  \"\"        \"\" &&\n> +\tcommit_check_warn true  \"auto\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\"        \"\" &&\n> +\tcommit_check_warn input \"auto\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\" \"\"        \"\"\n>  '\n>  \n>  test_expect_success 'commit files attr=text' '\n> -\tcommit_check_warn false \"text\" \"$WILC\"  \"$WICL\"    \"$WAMIX\"  \"$WILC\"  \"$WICL\" &&\n> -\tcommit_check_warn true  \"text\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\"        &&\n> -\tcommit_check_warn input \"text\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \"\"        \"CRLF_LF\"\n> +\tcommit_check_warn false \"text\" \"$WILC\"   \"$WICL\"   \"$WAMIX\"  \"$WAMIX\"  \"$WILC\"   \"$WICL\"   &&\n> +\tcommit_check_warn true  \"text\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"LF_CRLF\" \"\"        &&\n> +\tcommit_check_warn input \"text\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\" \"\"        \"CRLF_LF\"\n>  '\n>  \n>  test_expect_success 'commit files attr=-text' '\n> -\tcommit_check_warn false \"-text\" \"\"       \"\"        \"\"        \"\"        \"\" &&\n> -\tcommit_check_warn true  \"-text\" \"\"       \"\"        \"\"        \"\"        \"\" &&\n> -\tcommit_check_warn input \"-text\" \"\"       \"\"        \"\"        \"\"        \"\"\n> +\tcommit_check_warn false \"-text\" \"\"       \"\"        \"\"        \"\"        \"\"        \"\" &&\n> +\tcommit_check_warn true  \"-text\" \"\"       \"\"        \"\"        \"\"        \"\"        \"\" &&\n> +\tcommit_check_warn input \"-text\" \"\"       \"\"        \"\"        \"\"        \"\"        \"\"\n>  '\n>  \n>  test_expect_success 'commit files attr=lf' '\n> -\tcommit_check_warn false \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\"  \"\"       \"CRLF_LF\" &&\n> -\tcommit_check_warn true  \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\"  \"\"       \"CRLF_LF\" &&\n> -\tcommit_check_warn input \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\"  \"\"       \"CRLF_LF\"\n> +\tcommit_check_warn false \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\"  \"\"       \"CRLF_LF\" &&\n> +\tcommit_check_warn true  \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\"  \"\"       \"CRLF_LF\" &&\n> +\tcommit_check_warn input \"lf\"    \"\"       \"CRLF_LF\" \"CRLF_LF\" \"CRLF_LF\"  \"\"       \"CRLF_LF\"\n>  '\n>  \n>  test_expect_success 'commit files attr=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> +\tcommit_check_warn false \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"LF_CRLF\" \"\" &&\n> +\tcommit_check_warn true  \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"LF_CRLF\" \"\" &&\n> +\tcommit_check_warn input \"crlf\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"LF_CRLF\" \"\"\n>  '\n>  \n>  test_expect_success 'create files cleanup' '\n> @@ -268,79 +279,81 @@ test_expect_success 'commit -text' '\n>  #                    eol     acrlf\n>  #                                            ----------------------------------------------\n>  #                                            What we want to have in the working tree:\n> -if test_have_prereq MINGW\n> +if test_have_prereq NATIVE_CRLF\n>  then\n>  MIX_CRLF_LF=CRLF\n>  MIX_LF_CR=CRLF_mix_CR\n>  NL=CRLF\n> +LFNUL=CRLF_nul\n>  else\n>  MIX_CRLF_LF=CRLF_mix_LF\n>  MIX_LF_CR=LF_mix_CR\n>  NL=LF\n> +LFNUL=LF_nul\n>  fi\n>  export CRLF_MIX_LF_CR MIX NL\n>  \n> -checkout_files    lf      false  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    lf      true   \"\"       CRLF  CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    lf      input  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    lf      false \"auto\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    lf      true  \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    CRLF_nul\n> -checkout_files    lf      input \"auto\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    lf      false \"text\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> +checkout_files    lf      false  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    lf      true   \"\"       CRLF  CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    lf      input  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    lf      false \"auto\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    lf      true  \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    LF_nul\n> +checkout_files    lf      input \"auto\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    lf      false \"text\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n>  checkout_files    lf      true  \"text\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n> -checkout_files    lf      input \"text\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    lf      false \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    lf      true  \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    lf      input \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    lf      false \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    lf      true  \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    lf      input \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> +checkout_files    lf      input \"text\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    lf      false \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    lf      true  \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    lf      input \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    lf      false \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    lf      true  \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    lf      input \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n>  checkout_files    lf      false \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n>  checkout_files    lf      true  \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n>  checkout_files    lf      input \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n>  \n> -checkout_files    crlf    false  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    crlf    true   \"\"       CRLF  CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    crlf    false \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    CRLF_nul\n> -checkout_files    crlf    true  \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    CRLF_nul\n> +checkout_files    crlf    false  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    crlf    true   \"\"       CRLF  CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    crlf    false \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    LF_nul\n> +checkout_files    crlf    true  \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    LF_nul\n>  checkout_files    crlf    false \"text\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n>  checkout_files    crlf    true  \"text\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n> -checkout_files    crlf    false \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    crlf    true  \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    crlf    false \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    crlf    true  \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> +checkout_files    crlf    false \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    crlf    true  \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    crlf    false \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    crlf    true  \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n>  checkout_files    crlf    false \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n>  checkout_files    crlf    true  \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n>  \n> -checkout_files    \"\"      false  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    \"\"      true   \"\"       CRLF  CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    \"\"      input  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    \"\"      false \"auto\"    $NL   CRLF  $MIX_CRLF_LF LF_mix_CR    CRLF_nul\n> -checkout_files    \"\"      true  \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    CRLF_nul\n> -checkout_files    \"\"      input \"auto\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    \"\"      false \"text\"    $NL   CRLF  $MIX_CRLF_LF $MIX_LF_CR   CRLF_nul\n> +checkout_files    \"\"      false  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    \"\"      true   \"\"       CRLF  CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    \"\"      input  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    \"\"      false \"auto\"    $NL   CRLF  $MIX_CRLF_LF LF_mix_CR    LF_nul\n> +checkout_files    \"\"      true  \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    LF_nul\n> +checkout_files    \"\"      input \"auto\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    \"\"      false \"text\"    $NL   CRLF  $MIX_CRLF_LF $MIX_LF_CR   $LFNUL\n>  checkout_files    \"\"      true  \"text\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n> -checkout_files    \"\"      input \"text\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    \"\"      false \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    \"\"      true  \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    \"\"      input \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    \"\"      false \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    \"\"      true  \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    \"\"      input \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> +checkout_files    \"\"      input \"text\"    LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    \"\"      false \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    \"\"      true  \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    \"\"      input \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    \"\"      false \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    \"\"      true  \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    \"\"      input \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n>  checkout_files    \"\"      false \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n>  checkout_files    \"\"      true  \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n>  checkout_files    \"\"      input \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n>  \n> -checkout_files    native  false  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    native  true   \"\"       CRLF  CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    native  false \"auto\"    $NL   CRLF  $MIX_CRLF_LF LF_mix_CR    CRLF_nul\n> -checkout_files    native  true  \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    CRLF_nul\n> -checkout_files    native  false \"text\"    $NL   CRLF  $MIX_CRLF_LF $MIX_LF_CR   CRLF_nul\n> +checkout_files    native  false  \"\"       LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    native  true   \"\"       CRLF  CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    native  false \"auto\"    $NL   CRLF  $MIX_CRLF_LF LF_mix_CR    LF_nul\n> +checkout_files    native  true  \"auto\"    CRLF  CRLF  CRLF         LF_mix_CR    LF_nul\n> +checkout_files    native  false \"text\"    $NL   CRLF  $MIX_CRLF_LF $MIX_LF_CR   $LFNUL\n>  checkout_files    native  true  \"text\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n> -checkout_files    native  false \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    native  true  \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    native  false \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> -checkout_files    native  true  \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    CRLF_nul\n> +checkout_files    native  false \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    native  true  \"-text\"   LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    native  false \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n> +checkout_files    native  true  \"lf\"      LF    CRLF  CRLF_mix_LF  LF_mix_CR    LF_nul\n>  checkout_files    native  false \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n>  checkout_files    native  true  \"crlf\"    CRLF  CRLF  CRLF         CRLF_mix_CR  CRLF_nul\n"},{"id":"260007","messageId":"553C0A9B.7060407@web.de","threadId":"39158","inReplyTo":"xmqqegn817pr.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v2] t0027: Add repoMIX and LF_nul","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2015-04-25T21:43:55Z","receivedAt":"2015-04-25T21:43:55Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2015-04-25 18.41, Junio C Hamano wrote:\n> Torsten Bögershausen <tboegi@web.de> writes:\n> \n>> \"new safer autocrlf handling\":\n>>   Check if eols in a file are converted at commit, when the file has\n>>   CR (or CLLF) in the repo (technically speaking in the index).\n> \n> s/CLLF/CRLF/?  (no need to resend for this; I'll locally amend)\n> \n>>   Add a test-file repoMIX with mixed line-endings.\n>>   When converting LF->CRLF or CRLF->LF: check the warnings\n>>\n>> checkout_files():\n>>   Checking out CRLF_nul and checking for eol coversion does not\n>>   make much sense (CRLF will stay CRLF).\n> \n> Hmph, would it still make sense to make sure that CRLF will stay CRLF\n> so that future changes to break this expectation can be caught?  Not\n> that such a breakage is likely...\n\nThanks for amending.\n\nWe have the file CRLF (and CRLFmixLF), where we check that CRLF stays CRLF and is not\nconverted into CRLFLF.\n\nThe LF_nul is to test the \"auto text detection\":\nIt should not be converted into CRLF_nul in \"auto mode\",\nbut should be converted when declared as \"text\" in .gitattributes.\n"},{"id":"260011","messageId":"xmqqbnibzezj.fsf@gitster.dls.corp.google.com","threadId":"39158","inReplyTo":"553C0A9B.7060407@web.de","subject":"Re: [PATCH v2] t0027: Add repoMIX and LF_nul","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-04-26T04:32:32Z","receivedAt":"2015-04-26T04:32:32Z","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\n>> Hmph, would it still make sense to make sure that CRLF will stay CRLF\n>> so that future changes to break this expectation can be caught?  Not\n>> that such a breakage is likely...\n>\n> Thanks for amending.\n>\n> We have the file CRLF (and CRLFmixLF), where we check that CRLF stays CRLF and is not\n> converted into CRLFLF.\n>\n> The LF_nul is to test the \"auto text detection\":\n> It should not be converted into CRLF_nul in \"auto mode\",\n> but should be converted when declared as \"text\" in .gitattributes.\n\nThe two paragraphs above may explain why the test would pass with\nthe current code, but is that sufficient assurance that other people\nin future changes would not break the \"It should not be\" with their\nbugs that you do not foresee at this moment?  Whenever you say \"it\nshould not be\", I hear \"if the code somehow does that, somebody\nbroke our code\", which in turn suggests me that catching that\ncondition with tests is a good thing.\n\nOr am I hearing you incorrectly?\n"}]}