{"thread":{"id":"26079","subject":"git-archive and core.eol","startedAt":"2010-12-15T22:32:51Z","lastAt":"2011-01-11T19:24:24Z","messageCount":7,"participants":["Erik Faye-Lund","René Scharfe"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"158197","messageId":"AANLkTi=kfE88F7dY5F_xtbEuh9DyUcN+ymeXqLMWztGQ@mail.gmail.com","threadId":"26079","inReplyTo":null,"subject":"git-archive and core.eol","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2010-12-15T22:32:51Z","receivedAt":"2010-12-15T22:32:51Z","isPatch":false,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"I recently tried the following on Windows:\n\n$ git init\nInitialized empty Git repository in c:/Users/kusma/test/.git/\n$ echo \"foo\nbar\" > test.txt\n$ git -c core.autocrlf=true add test.txt\nwarning: LF will be replaced by CRLF in test.txt.\nThe file will have its original line endings in your working directory.\n$ git commit -m.\n 1 files changed, 2 insertions(+), 0 deletions(-)\n create mode 100644 test.txt\n$ git -c core.autocrlf=true -c core.eol=lf archive --format=tar HEAD > test.tar\n$ tar xvf test.tar\n$ od -c test.txt\n0000000   f   o   o  \\r  \\n   b   a   r  \\r  \\n\n0000012\n\nJust to be sure, I checked this:\n\n$ git show HEAD:test.txt | od -c\n0000000   f   o   o  \\n   b   a   r  \\n\n0000010\n\nYep, the file has LF in the repo, as expected... the warning from\ngit-add is a bit confusing, but OK.\n\nHmm, so git-archive writes CRLF even if I said I wanted LF. But then I\ntried this on Linux:\n\n$ git init\nInitialized empty Git repository in /home/kusma/src/test/.git/\n$ echo \"foo\nbar\" > test.txt\n$ git add test.txt\n$ git commit -m.\n[master (root-commit) c6f195e] .\n 1 files changed, 2 insertions(+), 0 deletions(-)\n create mode 100644 test.txt\n$ git -c core.autocrlf=true -c core.eol=crlf archive --format=tar HEAD\n> test.tar\n$ tar xvf test.tar\ntest.txt\n$ od -c test.txt\n0000000   f   o   o  \\r  \\n   b   a   r  \\r  \\n\n0000012\n\nThis leaves me a bit puzzled. On Linux, I can override the default\nnew-line style CRLF for git-archive, but I can't override it to LF on\nWindows?\n\nI expected it to work because sha1_file_to_archive calls\nconvert_to_working_tree. I've tried stepping through the code, but I\ndon't quite understand where it goes wrong. Or even how the code is\nsupposed to work :P\n\nDoes anyone have any clue what's going on? I'm running with the\ncurrent master, git version 1.7.3.3.585.g74f6e.\n"},{"id":"159214","messageId":"4D28683B.4020400@lsrfire.ath.cx","threadId":"26079","inReplyTo":"AANLkTi=kfE88F7dY5F_xtbEuh9DyUcN+ymeXqLMWztGQ@mail.gmail.com","subject":"Re: git-archive and core.eol","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2011-01-08T13:35:55Z","receivedAt":"2011-01-08T13:35:55Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 15.12.2010 23:32, schrieb Erik Faye-Lund:\n> I recently tried the following on Windows:\n> \n> $ git init\n> Initialized empty Git repository in c:/Users/kusma/test/.git/\n> $ echo \"foo\n> bar\" > test.txt\n> $ git -c core.autocrlf=true add test.txt\n> warning: LF will be replaced by CRLF in test.txt.\n> The file will have its original line endings in your working directory.\n> $ git commit -m.\n>  1 files changed, 2 insertions(+), 0 deletions(-)\n>  create mode 100644 test.txt\n> $ git -c core.autocrlf=true -c core.eol=lf archive --format=tar HEAD > test.tar\n> $ tar xvf test.tar\n> $ od -c test.txt\n> 0000000   f   o   o  \\r  \\n   b   a   r  \\r  \\n\n> 0000012\n> \n> Just to be sure, I checked this:\n> \n> $ git show HEAD:test.txt | od -c\n> 0000000   f   o   o  \\n   b   a   r  \\n\n> 0000010\n> \n> Yep, the file has LF in the repo, as expected... the warning from\n> git-add is a bit confusing, but OK.\n> \n> Hmm, so git-archive writes CRLF even if I said I wanted LF. But then I\n> tried this on Linux:\n> \n> $ git init\n> Initialized empty Git repository in /home/kusma/src/test/.git/\n> $ echo \"foo\n> bar\" > test.txt\n> $ git add test.txt\n> $ git commit -m.\n> [master (root-commit) c6f195e] .\n>  1 files changed, 2 insertions(+), 0 deletions(-)\n>  create mode 100644 test.txt\n> $ git -c core.autocrlf=true -c core.eol=crlf archive --format=tar HEAD\n>> test.tar\n> $ tar xvf test.tar\n> test.txt\n> $ od -c test.txt\n> 0000000   f   o   o  \\r  \\n   b   a   r  \\r  \\n\n> 0000012\n> \n> This leaves me a bit puzzled. On Linux, I can override the default\n> new-line style CRLF for git-archive, but I can't override it to LF on\n> Windows?\n> \n> I expected it to work because sha1_file_to_archive calls\n> convert_to_working_tree. I've tried stepping through the code, but I\n> don't quite understand where it goes wrong. Or even how the code is\n> supposed to work :P\n> \n> Does anyone have any clue what's going on? I'm running with the\n> current master, git version 1.7.3.3.585.g74f6e.\n\nI can't seem to replicate this (1.7.4-rc1); see below for the test script\nI tried to come up with.  It should test all combinations of the relevant\nconfig variables and the text attribute.  I cheated by simply setting the\nexpectations to match the results on Linux; I didn't check if these are\nindeed the correct results.  The test passes for me on MinGW, too, though.\n\nDid I miss a variable or are some of the expectations wrong?\n\nThanks,\nRené\n\n\n t/t5002-archive-eol.sh |   86 ++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 86 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t5002-archive-eol.sh b/t/t5002-archive-eol.sh\nnew file mode 100755\nindex 0000000..50f80f7\n--- /dev/null\n+++ b/t/t5002-archive-eol.sh\n@@ -0,0 +1,86 @@\n+#!/bin/sh\n+\n+test_description='git archive EOL tests'\n+\n+. ./test-lib.sh\n+\n+prepare() {\n+\ttfile=\"autocrlf_$1-eol_$2.tar\"\n+\tdir=\"autocrlf_$1-eol_$2.d\"\n+\ttest_expect_success \"archive with autocrlf=$1 eol=$2\" \"\n+\t\tgit -c core.autocrlf=$1 -c core.eol=$2 archive HEAD >$tfile &&\n+\t\t(mkdir $dir && cd $dir && \\\"$TAR\\\" xf -) <$tfile\n+\t\"\n+}\n+\n+expect_success() {\n+\tfile=\"autocrlf_$2-eol_$3.d/autocrlf_$1/$4\"\n+\tdesc=\"add autocrlf=$1, archive autocrlf=$2 eol=$3\"\n+\ttest_expect_success \"$desc: $4 => $5\" \"test_cmp $5 $file\"\n+}\n+\n+test_expect_success 'setup' '\n+\tprintf \"1\\\\n2\\\\n\" >lf &&\n+\tprintf \"1\\\\r\\\\n2\\\\r\\\\n\" >crlf &&\n+\n+\techo \"*.txt text\" >.gitattributes &&\n+\tgit add .gitattributes &&\n+\n+\tmkdir autocrlf_false &&\n+\tcp lf crlf autocrlf_false/ &&\n+\tcp lf autocrlf_false/lf.txt &&\n+\tcp crlf autocrlf_false/crlf.txt &&\n+\tgit -c core.autocrlf=false add autocrlf_false/ &&\n+\n+\tmkdir autocrlf_true &&\n+\tcp lf crlf autocrlf_true/ &&\n+\tcp lf autocrlf_true/lf.txt &&\n+\tcp crlf autocrlf_true/crlf.txt &&\n+\tgit -c core.autocrlf=true add autocrlf_true/ &&\n+\n+\tgit commit -m.\n+'\n+\n+#\tcore.autocrlf\tcore.eol\n+prepare\tfalse\t\tcrlf\n+prepare\ttrue\t\tcrlf\n+prepare\tfalse\t\tlf\n+prepare\ttrue\t\tlf\n+\n+#\t\tcore.autocrlf\tcore.eol\toriginal\texpect\n+#\t\t(add)\t(archive)\n+expect_success\tfalse\tfalse\tcrlf\t\tcrlf\t\tcrlf\n+expect_success\tfalse\tfalse\tcrlf\t\tlf\t\tlf\n+expect_success\tfalse\tfalse\tlf\t\tcrlf\t\tcrlf\n+expect_success\tfalse\tfalse\tlf\t\tlf\t\tlf\n+expect_success\tfalse\ttrue\tcrlf\t\tcrlf\t\tcrlf\n+expect_success\tfalse\ttrue\tcrlf\t\tlf\t\tcrlf\n+expect_success\tfalse\ttrue\tlf\t\tcrlf\t\tcrlf\n+expect_success\tfalse\ttrue\tlf\t\tlf\t\tcrlf\n+expect_success\ttrue\tfalse\tcrlf\t\tcrlf\t\tlf\n+expect_success\ttrue\tfalse\tcrlf\t\tlf\t\tlf\n+expect_success\ttrue\tfalse\tlf\t\tcrlf\t\tlf\n+expect_success\ttrue\tfalse\tlf\t\tlf\t\tlf\n+expect_success\ttrue\ttrue\tcrlf\t\tcrlf\t\tcrlf\n+expect_success\ttrue\ttrue\tcrlf\t\tlf\t\tcrlf\n+expect_success\ttrue\ttrue\tlf\t\tcrlf\t\tcrlf\n+expect_success\ttrue\ttrue\tlf\t\tlf\t\tcrlf\n+\n+expect_success\tfalse\tfalse\tcrlf\t\tcrlf.txt\tcrlf\n+expect_success\tfalse\tfalse\tcrlf\t\tlf.txt\t\tcrlf\n+expect_success\tfalse\tfalse\tlf\t\tcrlf.txt\tlf\n+expect_success\tfalse\tfalse\tlf\t\tlf.txt\t\tlf\n+expect_success\tfalse\ttrue\tcrlf\t\tcrlf.txt\tcrlf\n+expect_success\tfalse\ttrue\tcrlf\t\tlf.txt\t\tcrlf\n+expect_success\tfalse\ttrue\tlf\t\tcrlf.txt\tcrlf\n+expect_success\tfalse\ttrue\tlf\t\tlf.txt\t\tcrlf\n+expect_success\ttrue\tfalse\tcrlf\t\tcrlf.txt\tcrlf\n+expect_success\ttrue\tfalse\tcrlf\t\tlf.txt\t\tcrlf\n+expect_success\ttrue\tfalse\tlf\t\tcrlf.txt\tlf\n+expect_success\ttrue\tfalse\tlf\t\tlf.txt\t\tlf\n+expect_success\ttrue\ttrue\tcrlf\t\tcrlf.txt\tcrlf\n+expect_success\ttrue\ttrue\tcrlf\t\tlf.txt\t\tcrlf\n+expect_success\ttrue\ttrue\tlf\t\tcrlf.txt\tcrlf\n+expect_success\ttrue\ttrue\tlf\t\tlf.txt\t\tcrlf\n+\n+test_done\n"},{"id":"159228","messageId":"AANLkTi==eqwrwq-P6czDvOH5GDEi6WgvRUuZ2dMoiK7e@mail.gmail.com","threadId":"26079","inReplyTo":"4D28683B.4020400@lsrfire.ath.cx","subject":"Re: git-archive and core.eol","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2011-01-08T17:28:35Z","receivedAt":"2011-01-08T17:28:35Z","isPatch":false,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Sat, Jan 8, 2011 at 2:35 PM, René Scharfe\n<rene.scharfe@lsrfire.ath.cx> wrote:\n> Am 15.12.2010 23:32, schrieb Erik Faye-Lund:\n>> I recently tried the following on Windows:\n>>\n>> $ git init\n>> Initialized empty Git repository in c:/Users/kusma/test/.git/\n>> $ echo \"foo\n>> bar\" > test.txt\n>> $ git -c core.autocrlf=true add test.txt\n>> warning: LF will be replaced by CRLF in test.txt.\n>> The file will have its original line endings in your working directory.\n>> $ git commit -m.\n>>  1 files changed, 2 insertions(+), 0 deletions(-)\n>>  create mode 100644 test.txt\n>> $ git -c core.autocrlf=true -c core.eol=lf archive --format=tar HEAD > test.tar\n>> $ tar xvf test.tar\n>> $ od -c test.txt\n>> 0000000   f   o   o  \\r  \\n   b   a   r  \\r  \\n\n>> 0000012\n>>\n>> Just to be sure, I checked this:\n>>\n>> $ git show HEAD:test.txt | od -c\n>> 0000000   f   o   o  \\n   b   a   r  \\n\n>> 0000010\n>>\n>> Yep, the file has LF in the repo, as expected... the warning from\n>> git-add is a bit confusing, but OK.\n>>\n>> Hmm, so git-archive writes CRLF even if I said I wanted LF. But then I\n>> tried this on Linux:\n>>\n>> $ git init\n>> Initialized empty Git repository in /home/kusma/src/test/.git/\n>> $ echo \"foo\n>> bar\" > test.txt\n>> $ git add test.txt\n>> $ git commit -m.\n>> [master (root-commit) c6f195e] .\n>>  1 files changed, 2 insertions(+), 0 deletions(-)\n>>  create mode 100644 test.txt\n>> $ git -c core.autocrlf=true -c core.eol=crlf archive --format=tar HEAD\n>>> test.tar\n>> $ tar xvf test.tar\n>> test.txt\n>> $ od -c test.txt\n>> 0000000   f   o   o  \\r  \\n   b   a   r  \\r  \\n\n>> 0000012\n>>\n>> This leaves me a bit puzzled. On Linux, I can override the default\n>> new-line style CRLF for git-archive, but I can't override it to LF on\n>> Windows?\n>>\n>> I expected it to work because sha1_file_to_archive calls\n>> convert_to_working_tree. I've tried stepping through the code, but I\n>> don't quite understand where it goes wrong. Or even how the code is\n>> supposed to work :P\n>>\n>> Does anyone have any clue what's going on? I'm running with the\n>> current master, git version 1.7.3.3.585.g74f6e.\n>\n> I can't seem to replicate this (1.7.4-rc1); see below for the test script\n> I tried to come up with.  It should test all combinations of the relevant\n> config variables and the text attribute.  I cheated by simply setting the\n> expectations to match the results on Linux; I didn't check if these are\n> indeed the correct results.  The test passes for me on MinGW, too, though.\n>\n> Did I miss a variable or are some of the expectations wrong?\n>\n> Thanks,\n> René\n>\n\n\nReally? I haven't looked through what the test actually does (I'm out\nsick right now, and don't have many working brain-cells), but every\nsingle test fails for me:\n\nnot ok - 1 setup\n#\t\n#\t\tprintf \"1\\\\n2\\\\n\" >lf &&\n#\t\tprintf \"1\\\\r\\\\n2\\\\r\\\\n\" >crlf &&\n#\t\n#\t\techo \"*.txt text\" >.gitattributes &&\n#\t\tgit add .gitattributes &&\n#\t\n#\t\tmkdir autocrlf_false &&\n#\t\tcp lf crlf autocrlf_false/ &&\n#\t\tcp lf autocrlf_false/lf.txt &&\n#\t\tcp crlf autocrlf_false/crlf.txt &&\n#\t\tgit -c core.autocrlf=false add autocrlf_false/ &&\n#\t\n#\t\tmkdir autocrlf_true &&\n#\t\tcp lf crlf autocrlf_true/ &&\n#\t\tcp lf autocrlf_true/lf.txt &&\n#\t\tcp crlf autocrlf_true/crlf.txt &&\n#\t\tgit -c core.autocrlf=true add autocrlf_true/ &&\n#\t\n#\t\tgit commit -m.\n#\t\nnot ok - 2 archive with autocrlf=false eol=crlf\n#\t\n#\t\t\tgit -c core.autocrlf=false -c core.eol=crlf archive HEAD\n>autocrlf_false-eol_crlf.tar &&\n#\t\t\t(mkdir autocrlf_false-eol_crlf.d && cd autocrlf_false-eol_crlf.d\n&& \"tar\" xf -) <autocrlf_false-eol_crlf.tar\n#\t\t\nnot ok - 3 archive with autocrlf=true eol=crlf\n#\t\n#\t\t\tgit -c core.autocrlf=true -c core.eol=crlf archive HEAD\n>autocrlf_true-eol_crlf.tar &&\n#\t\t\t(mkdir autocrlf_true-eol_crlf.d && cd autocrlf_true-eol_crlf.d &&\n\"tar\" xf -) <autocrlf_true-eol_crlf.tar\n#\t\t\nnot ok - 4 archive with autocrlf=false eol=lf\n#\t\n#\t\t\tgit -c core.autocrlf=false -c core.eol=lf archive HEAD\n>autocrlf_false-eol_lf.tar &&\n#\t\t\t(mkdir autocrlf_false-eol_lf.d && cd autocrlf_false-eol_lf.d &&\n\"tar\" xf -) <autocrlf_false-eol_lf.tar\n#\t\t\nnot ok - 5 archive with autocrlf=true eol=lf\n#\t\n#\t\t\tgit -c core.autocrlf=true -c core.eol=lf archive HEAD\n>autocrlf_true-eol_lf.tar &&\n#\t\t\t(mkdir autocrlf_true-eol_lf.d && cd autocrlf_true-eol_lf.d &&\n\"tar\" xf -) <autocrlf_true-eol_lf.tar\n#\t\t\nnot ok - 6 add autocrlf=false, archive autocrlf=false eol=crlf: crlf => crlf\n#\ttest_cmp crlf autocrlf_false-eol_crlf.d/autocrlf_false/crlf\nnot ok - 7 add autocrlf=false, archive autocrlf=false eol=crlf: lf => lf\n#\ttest_cmp lf autocrlf_false-eol_crlf.d/autocrlf_false/lf\nnot ok - 8 add autocrlf=false, archive autocrlf=false eol=lf: crlf => crlf\n#\ttest_cmp crlf autocrlf_false-eol_lf.d/autocrlf_false/crlf\nnot ok - 9 add autocrlf=false, archive autocrlf=false eol=lf: lf => lf\n#\ttest_cmp lf autocrlf_false-eol_lf.d/autocrlf_false/lf\nnot ok - 10 add autocrlf=false, archive autocrlf=true eol=crlf: crlf => crlf\n#\ttest_cmp crlf autocrlf_true-eol_crlf.d/autocrlf_false/crlf\nnot ok - 11 add autocrlf=false, archive autocrlf=true eol=crlf: lf => crlf\n#\ttest_cmp crlf autocrlf_true-eol_crlf.d/autocrlf_false/lf\nnot ok - 12 add autocrlf=false, archive autocrlf=true eol=lf: crlf => crlf\n#\ttest_cmp crlf autocrlf_true-eol_lf.d/autocrlf_false/crlf\nnot ok - 13 add autocrlf=false, archive autocrlf=true eol=lf: lf => crlf\n#\ttest_cmp crlf autocrlf_true-eol_lf.d/autocrlf_false/lf\nnot ok - 14 add autocrlf=true, archive autocrlf=false eol=crlf: crlf => lf\n#\ttest_cmp lf autocrlf_false-eol_crlf.d/autocrlf_true/crlf\nnot ok - 15 add autocrlf=true, archive autocrlf=false eol=crlf: lf => lf\n#\ttest_cmp lf autocrlf_false-eol_crlf.d/autocrlf_true/lf\nnot ok - 16 add autocrlf=true, archive autocrlf=false eol=lf: crlf => lf\n#\ttest_cmp lf autocrlf_false-eol_lf.d/autocrlf_true/crlf\nnot ok - 17 add autocrlf=true, archive autocrlf=false eol=lf: lf => lf\n#\ttest_cmp lf autocrlf_false-eol_lf.d/autocrlf_true/lf\nnot ok - 18 add autocrlf=true, archive autocrlf=true eol=crlf: crlf => crlf\n#\ttest_cmp crlf autocrlf_true-eol_crlf.d/autocrlf_true/crlf\nnot ok - 19 add autocrlf=true, archive autocrlf=true eol=crlf: lf => crlf\n#\ttest_cmp crlf autocrlf_true-eol_crlf.d/autocrlf_true/lf\nnot ok - 20 add autocrlf=true, archive autocrlf=true eol=lf: crlf => crlf\n#\ttest_cmp crlf autocrlf_true-eol_lf.d/autocrlf_true/crlf\nnot ok - 21 add autocrlf=true, archive autocrlf=true eol=lf: lf => crlf\n#\ttest_cmp crlf autocrlf_true-eol_lf.d/autocrlf_true/lf\nnot ok - 22 add autocrlf=false, archive autocrlf=false eol=crlf:\ncrlf.txt => crlf\n#\ttest_cmp crlf autocrlf_false-eol_crlf.d/autocrlf_false/crlf.txt\nnot ok - 23 add autocrlf=false, archive autocrlf=false eol=crlf: lf.txt => crlf\n#\ttest_cmp crlf autocrlf_false-eol_crlf.d/autocrlf_false/lf.txt\nnot ok - 24 add autocrlf=false, archive autocrlf=false eol=lf: crlf.txt => lf\n#\ttest_cmp lf autocrlf_false-eol_lf.d/autocrlf_false/crlf.txt\nnot ok - 25 add autocrlf=false, archive autocrlf=false eol=lf: lf.txt => lf\n#\ttest_cmp lf autocrlf_false-eol_lf.d/autocrlf_false/lf.txt\nnot ok - 26 add autocrlf=false, archive autocrlf=true eol=crlf: crlf.txt => crlf\n#\ttest_cmp crlf autocrlf_true-eol_crlf.d/autocrlf_false/crlf.txt\nnot ok - 27 add autocrlf=false, archive autocrlf=true eol=crlf: lf.txt => crlf\n#\ttest_cmp crlf autocrlf_true-eol_crlf.d/autocrlf_false/lf.txt\nnot ok - 28 add autocrlf=false, archive autocrlf=true eol=lf: crlf.txt => crlf\n#\ttest_cmp crlf autocrlf_true-eol_lf.d/autocrlf_false/crlf.txt\nnot ok - 29 add autocrlf=false, archive autocrlf=true eol=lf: lf.txt => crlf\n#\ttest_cmp crlf autocrlf_true-eol_lf.d/autocrlf_false/lf.txt\nnot ok - 30 add autocrlf=true, archive autocrlf=false eol=crlf: crlf.txt => crlf\n#\ttest_cmp crlf autocrlf_false-eol_crlf.d/autocrlf_true/crlf.txt\nnot ok - 31 add autocrlf=true, archive autocrlf=false eol=crlf: lf.txt => crlf\n#\ttest_cmp crlf autocrlf_false-eol_crlf.d/autocrlf_true/lf.txt\nnot ok - 32 add autocrlf=true, archive autocrlf=false eol=lf: crlf.txt => lf\n#\ttest_cmp lf autocrlf_false-eol_lf.d/autocrlf_true/crlf.txt\nnot ok - 33 add autocrlf=true, archive autocrlf=false eol=lf: lf.txt => lf\n#\ttest_cmp lf autocrlf_false-eol_lf.d/autocrlf_true/lf.txt\nnot ok - 34 add autocrlf=true, archive autocrlf=true eol=crlf: crlf.txt => crlf\n#\ttest_cmp crlf autocrlf_true-eol_crlf.d/autocrlf_true/crlf.txt\nnot ok - 35 add autocrlf=true, archive autocrlf=true eol=crlf: lf.txt => crlf\n#\ttest_cmp crlf autocrlf_true-eol_crlf.d/autocrlf_true/lf.txt\nnot ok - 36 add autocrlf=true, archive autocrlf=true eol=lf: crlf.txt => crlf\n#\ttest_cmp crlf autocrlf_true-eol_lf.d/autocrlf_true/crlf.txt\nnot ok - 37 add autocrlf=true, archive autocrlf=true eol=lf: lf.txt => crlf\n#\ttest_cmp crlf autocrlf_true-eol_lf.d/autocrlf_true/lf.txt\n# failed 37 among 37 test(s)\n1..37\n\n$ git --version\ngit version 1.7.4.rc1.3196.gfd693\n\n(This is the current 'devel'-branch from\ngit://repo.or.cz/git/mingw/4msysgit.git)\n"},{"id":"159242","messageId":"4D29AF80.5060008@lsrfire.ath.cx","threadId":"26079","inReplyTo":"AANLkTi==eqwrwq-P6czDvOH5GDEi6WgvRUuZ2dMoiK7e@mail.gmail.com","subject":"Re: git-archive and core.eol","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2011-01-09T12:52:16Z","receivedAt":"2011-01-09T12:52:16Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 08.01.2011 18:28, schrieb Erik Faye-Lund:\n> Really? I haven't looked through what the test actually does (I'm out\n> sick right now, and don't have many working brain-cells), but every\n> single test fails for me:\n[...]\n> $ git --version\n> git version 1.7.4.rc1.3196.gfd693\n> \n> (This is the current 'devel'-branch from\n> git://repo.or.cz/git/mingw/4msysgit.git)\n\nI cloned it, but even though it reports a different version string for\nme we probably use the same (fd6937e0e6ccb78eb4347c427248e25c2d6739c8):\n\n\t$ ./git version\n\tgit version 1.7.3.4.3902.gfd693\n\nAnd all the tests succeed for me (on Windows Vista Home Premium x64)\nwith that one.\n\nI'm especially interested in how the setup step manages to fail for you.\n But first, get well soon!\n\nRené\n"},{"id":"159264","messageId":"AANLkTinxVCQuTMeKHQ9mLbs=94fck90rwJwa1DhzGPmX@mail.gmail.com","threadId":"26079","inReplyTo":"4D29AF80.5060008@lsrfire.ath.cx","subject":"Re: git-archive and core.eol","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2011-01-10T12:11:23Z","receivedAt":"2011-01-10T12:11:23Z","isPatch":false,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Sun, Jan 9, 2011 at 1:52 PM, René Scharfe\n<rene.scharfe@lsrfire.ath.cx> wrote:\n> Am 08.01.2011 18:28, schrieb Erik Faye-Lund:\n>> Really? I haven't looked through what the test actually does (I'm out\n>> sick right now, and don't have many working brain-cells), but every\n>> single test fails for me:\n> [...]\n>> $ git --version\n>> git version 1.7.4.rc1.3196.gfd693\n>>\n>> (This is the current 'devel'-branch from\n>> git://repo.or.cz/git/mingw/4msysgit.git)\n>\n> I cloned it, but even though it reports a different version string for\n> me we probably use the same (fd6937e0e6ccb78eb4347c427248e25c2d6739c8):\n>\n>        $ ./git version\n>        git version 1.7.3.4.3902.gfd693\n>\n\nThis is probably just because you haven't pulled junio's repo\nrecently, which contains the 1.7.4.rc1 tag. The tip is the same,\nindeed.\n\n> And all the tests succeed for me (on Windows Vista Home Premium x64)\n> with that one.\n>\n\nI'm on Vista 64 if that matters. And I'm using msysGit e59039e.\n\n> I'm especially interested in how the setup step manages to fail for you.\n\nIt's the line \"git add .gitattributes\" is the first that fails in\n'setup'. Actually, all git-commands seems to fail.\n\nBut now I also observe that just trying to run t0000-basic fails:\n\n$ ./t0000-basic.sh\n./t0000-basic.sh: line 24: ../git: is a directory\nYou do not seem to have built git yet.\n\nNow this is suspicious:\n$ ls ../git.exe\n../git.exe*\n\n$ ls ../git\nDebug/  git.vcproj  git.vcproj.Hue-PC.kusma.user  git.wwdb\n\nAha! The MSVC project generator creates a folder called 'git' at the\nroot, so anything trying to execute '../git' fails!\n\n$ ../git help\nsh.exe\": ../git: is a directory\n\nAfter deleting that folder, t0000-basic passes again. As does your\ntest. So now I've got to figure out what is different between your\ntest and mine. Perhaps I misdiagnosed to begin with?\n"},{"id":"159267","messageId":"AANLkTi=WyzVzPkhOAMC2A8Dd=Zj_P-7YMVP-GaUz0-Qm@mail.gmail.com","threadId":"26079","inReplyTo":"AANLkTinxVCQuTMeKHQ9mLbs=94fck90rwJwa1DhzGPmX@mail.gmail.com","subject":"Re: git-archive and core.eol","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2011-01-10T13:00:51Z","receivedAt":"2011-01-10T13:00:51Z","isPatch":false,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Mon, Jan 10, 2011 at 1:11 PM, Erik Faye-Lund <kusmabite@gmail.com> wrote:\n> test. So now I've got to figure out what is different between your\n> test and mine. Perhaps I misdiagnosed to begin with?\n>\n\nNo, it doesn't quite seem like I misdiagnosed, but your test had\ndifferent expectations than I have after reading the documentation. I\nexpected core.autocrlf=true + core.eol=lf to pretty much be identical\nto core.autocrlf=false, but only because LF->LF conversion is a NOP.\n\n'core.autocrlf' is documented as meaning the same as setting the\n'text' attribute to 'auto' for all files, plus \"files that contain\nCRLF in the repository will not be touched\". I figured that last part\nshouldn't affect me as I only had LFs in the repository.\n\nIf I disable core.autocrlf, I get what I want (no matter what I set\ncore.eol to, it seems). But I still don't understand WHY\ncore.autocrlf=true + core.eol=lf outputs CRLF.\n\nIt seems to me that there's a big gap between what the documentation\nclaims and what actually happens here.\n"},{"id":"159369","messageId":"4D2CAE68.3000908@lsrfire.ath.cx","threadId":"26079","inReplyTo":"AANLkTi=WyzVzPkhOAMC2A8Dd=Zj_P-7YMVP-GaUz0-Qm@mail.gmail.com","subject":"Re: git-archive and core.eol","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2011-01-11T19:24:24Z","receivedAt":"2011-01-11T19:24:24Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 10.01.2011 14:00, schrieb Erik Faye-Lund:\n> On Mon, Jan 10, 2011 at 1:11 PM, Erik Faye-Lund <kusmabite@gmail.com> wrote:\n>> test. So now I've got to figure out what is different between your\n>> test and mine. Perhaps I misdiagnosed to begin with?\n>>\n> \n> No, it doesn't quite seem like I misdiagnosed, but your test had\n> different expectations than I have after reading the documentation. I\n> expected core.autocrlf=true + core.eol=lf to pretty much be identical\n> to core.autocrlf=false, but only because LF->LF conversion is a NOP.\n> \n> 'core.autocrlf' is documented as meaning the same as setting the\n> 'text' attribute to 'auto' for all files, plus \"files that contain\n> CRLF in the repository will not be touched\". I figured that last part\n> shouldn't affect me as I only had LFs in the repository.\n> \n> If I disable core.autocrlf, I get what I want (no matter what I set\n> core.eol to, it seems). But I still don't understand WHY\n> core.autocrlf=true + core.eol=lf outputs CRLF.\n> \n> It seems to me that there's a big gap between what the documentation\n> claims and what actually happens here.\n\nHaving stared a bit at the test results, I think you only need to accept\nthat setting core.autocrlf=true during output overrules any core.eol\nsetting and gives you CRLF line endings no matter what's in the repository.\n\ncore.autocrlf=input overrules core.eol, too, in that no output conversion\ntakes place, no matter what the latter is set to.\n\nI don't know if this is intended or even useful -- I don't use the options\nmyself, so I don't grok the possible use cases.  Perhaps something like\nthis can help?  Or do we need code changes?\n\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex ff7c225..6082f77 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -202,7 +202,7 @@ core.eol::\n \t'lf', 'crlf' and 'native', which uses the platform's native\n \tline ending.  The default value is `native`.  See\n \tlinkgit:gitattributes[5] for more information on end-of-line\n-\tconversion.\n+\tconversion.  This variable is ignored if `core.autocrlf` is set.\n \n core.safecrlf::\n \tIf true, makes git check if converting `CRLF` is reversible when\n@@ -257,7 +257,8 @@ core.autocrlf::\n \tsetting if you want to have `CRLF` line endings in your\n \tworking directory even though the repository does not have\n \tnormalized line endings.  This variable can be set to 'input',\n-\tin which case no output conversion is performed.\n+\tin which case no output conversion is performed.  This variable\n+\toverrules `core.eol`.\n \n core.symlinks::\n \tIf false, symbolic links are checked out as small plain files that\n"}]}