{"thread":{"id":"39155","subject":"[PATCH] t0027: Add repoMIX and LF_nul","startedAt":"2015-04-24T19:46:27Z","lastAt":"2015-04-24T20:07:39Z","messageCount":2,"participants":["Torsten Bögershausen","Eric Sunshine"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"259958","messageId":"553A9D93.60901@web.de","threadId":"39155","inReplyTo":null,"subject":"[PATCH] t0027: Add repoMIX and LF_nul","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2015-04-24T19:46:27Z","receivedAt":"2015-04-24T19:46:27Z","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---\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..2482b2c 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+  repoMIX=$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":"259961","messageId":"CAPig+cSFBoZ=pjvob0GEem-fzn7G_7uROgtVCViTXiXowN=AbQ@mail.gmail.com","threadId":"39155","inReplyTo":"553A9D93.60901@web.de","subject":"Re: [PATCH] t0027: Add repoMIX and LF_nul","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-04-24T20:07:39Z","receivedAt":"2015-04-24T20:07:39Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Apr 24, 2015 at 3:46 PM, Torsten Bögershausen <tboegi@web.de> 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>\n> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n> ---\n> diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh\n> index 810934b..2482b2c 100755\n> --- a/t/t0027-auto-crlf.sh\n> +++ b/t/t0027-auto-crlf.sh\n> @@ -71,12 +71,21 @@ commit_check_warn () {\n>         attr=$2\n>         lfname=$3\n>         crlfname=$4\n> -       lfmixcrlf=$5\n> -       lfmixcr=$6\n> -       crlfnul=$7\n> -       create_gitattributes \"$attr\" &&\n> +  repoMIX=$5\n\nUnusual indentation.\n\n> +       lfmixcrlf=$6\n> +       lfmixcr=$7\n> +       crlfnul=$8\n>         pfx=crlf_${crlf}_attr_${attr}\n> -       for f in LF CRLF LF_mix_CR CRLF_mix_LF CRLF_nul\n> +       # Special handling for repoMIX: It should already be in the repo\n> +       # with CRLF\n> +       f=repoMIX\n> +       fname=${pfx}_$f.txt\n> +       echo >.gitattributes &&\n> +       cp $f $fname &&\n> +       git -c core.autocrlf=false add $fname 2>\"${pfx}_$f.err\" &&\n> +       git commit -m \"repoMIX\" &&\n> +       create_gitattributes \"$attr\" &&\n> +       for f in LF CRLF repoMIX LF_mix_CR CRLF_mix_LF LF_nul CRLF_nul\n>         do\n>                 fname=${pfx}_$f.txt &&\n>                 cp $f $fname &&\n"}]}