{"thread":{"id":"19301","subject":"[PATCH 1/6] Add core.autocrlf=true on cygwin by default during tests","startedAt":"2009-05-11T19:28:55Z","lastAt":"2009-05-14T14:39:41Z","messageCount":24,"participants":["Don Slutz","Eric Blake","Johannes Schindelin","Charles Bailey","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"113571","messageId":"1242070141-2936-1-git-send-email-Don.Slutz@SierraAtlantic.com","threadId":"19301","inReplyTo":null,"subject":"[PATCH 0/6] Add core.autocrlf=true on cygwin by default during tests","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-11T19:28:55Z","receivedAt":"2009-05-11T19:28:55Z","isPatch":true,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"This is a patch set to do the work from mail message:\n\nhttp://kerneltrap.org/mailarchive/git/2007/8/7/254415\n\nIt is split into 6 parts.  This is because the tests do not work on\nLinux if autocrlf=true.\n\n1) The change to autocrlf=true by default for cygwin\n\n2) Changes to t/test-lib.sh\n\n3) The simple changes to tests to use the new functions.\n\n4) Force core.autocrlf=false tests\n\n5) The changes that switch from using cmp to using test_cmp.\n\n6) Add 'make test-text' to use these changes\n"},{"id":"113570","messageId":"1242070141-2936-2-git-send-email-Don.Slutz@SierraAtlantic.com","threadId":"19301","inReplyTo":"1242070141-2936-1-git-send-email-Don.Slutz@SierraAtlantic.com","subject":"[PATCH 1/6] Add core.autocrlf=true on cygwin by default during tests","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-11T19:28:56Z","receivedAt":"2009-05-11T19:28:56Z","isPatch":true,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"It can be disabled or enabled by using the GIT_TEST_AUTO_CRLF environment\nvariable.\n\nSigned-off-by: Don Slutz <Don.Slutz@SierraAtlantic.com>\n---\n t/test-lib.sh |   16 ++++++++++++++++\n 1 files changed, 16 insertions(+), 0 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex dad1437..218bd82 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -119,6 +119,17 @@ do\n \tesac\n done\n \n+# Switch to core.autolf = true on cygwin but only by default\n+case $(uname -s) in\n+*CYGWIN*)\n+\tGIT_TEST_AUTO_CRLF=${GIT_TEST_AUTO_CRLF:-true}\n+\ttest \"$debug\" = \"\" ||\n+\techo \"Test in mode\" $(cygpath --mode . | cut -d: -f2-) \"mount\"\n+\t;;\n+*)\n+\t;;\n+esac\n+\n if test -n \"$color\"; then\n \tsay_color () {\n \t\t(\n@@ -493,6 +504,11 @@ test_create_repo () {\n \tcd \"$repo\" || error \"Cannot setup test environment\"\n \t\"$GIT_EXEC_PATH/git-init\" \"--template=$TEST_DIRECTORY/../templates/blt/\" >&3 2>&4 ||\n \terror \"cannot run git init -- have you built things yet?\"\n+\ttest ! -z \"$GIT_TEST_AUTO_CRLF\" &&\n+\ttest_debug \"echo Switching to autocrlf=$GIT_TEST_AUTO_CRLF\" && {\n+\t\tgit config core.autocrlf $GIT_TEST_AUTO_CRLF ||\n+\t\terror \"Failed to switch to autocrlf=$GIT_TEST_AUTO_CRLF\"\n+\t}\n \tmv .git/hooks .git/hooks-disabled\n \tcd \"$owd\"\n }\n-- \n1.6.3.15.g49878\n"},{"id":"113575","messageId":"1242070141-2936-3-git-send-email-Don.Slutz@SierraAtlantic.com","threadId":"19301","inReplyTo":"1242070141-2936-2-git-send-email-Don.Slutz@SierraAtlantic.com","subject":"[PATCH 2/6] Fix tests to work with core.autocrlf=true","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-11T19:28:57Z","receivedAt":"2009-05-11T19:28:57Z","isPatch":true,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"test-lib changes.\n\nRun the tests via:\n\n  GIT_TEST_AUTO_CRLF=true make test\n\nChange the default value of GIT_TEST_CMP to ignore whitespace changes\nwhen core.autocrlf=true\n\nAdd support functions: test_external_with_only_warning, test_eq_cat,\ntest_cat_eq, and test_ne_cat all of which will ignore CR if it is in\nthe file.\n\nSigned-off-by: Don Slutz <Don.Slutz@SierraAtlantic.com>\n---\n t/test-lib.sh |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-\n 1 files changed, 58 insertions(+), 1 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 218bd82..84846cd 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -59,7 +59,6 @@ export GIT_MERGE_VERBOSITY\n export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME\n export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME\n export EDITOR VISUAL\n-GIT_TEST_CMP=${GIT_TEST_CMP:-diff -u}\n \n # Protect ourselves from common misconfiguration to export\n # CDPATH into the environment\n@@ -129,6 +128,11 @@ case $(uname -s) in\n *)\n \t;;\n esac\n+if test ! -z $GIT_TEST_AUTO_CRLF && test $GIT_TEST_AUTO_CRLF = true; then\n+\tGIT_TEST_CMP=${GIT_TEST_CMP:-diff -uw}\n+else\n+\tGIT_TEST_CMP=${GIT_TEST_CMP:-diff -u}\n+fi\n \n if test -n \"$color\"; then\n \tsay_color () {\n@@ -459,6 +463,35 @@ test_external_without_stderr () {\n \tfi\n }\n \n+# Like test_external, but in addition tests that the command generated\n+# only \"warning: LF will be replaced by CRLF\" output on stderr.\n+test_external_with_only_warning () {\n+\t# The temporary file has no (and must have no) security\n+\t# implications.\n+\ttmp=\"$TMPDIR\"; if [ -z \"$tmp\" ]; then tmp=/tmp; fi\n+\tstderr=\"$tmp/git-external-stderr.$$.tmp\"\n+\ttest_external \"$@\" 4> \"$stderr\"\n+\t[ -f \"$stderr\" ] || error \"Internal error: $stderr disappeared.\"\n+\tdescr=\"only warning: $1\"\n+\tshift\n+\tsay >&3 \"expecting only warnings from previous command\"\n+\toutput=$(grep -v \"warning: LF will be replaced by CRLF in\" $stderr)\n+\ttest_debug \"echo non-warning: $output\"\n+\tif [ -z \"$output\" ]; then\n+\t\trm \"$stderr\"\n+\t\ttest_ok_ \"$descr\"\n+\telse\n+\t\tif [ \"$verbose\" = t ]; then\n+\t\t\toutput=`echo; echo Stderr is:; cat \"$stderr\"`\n+\t\telse\n+\t\t\toutput=\n+\t\tfi\n+\t\t# rm first in case test_failure exits.\n+\t\trm \"$stderr\"\n+\t\ttest_failure_ \"$descr\" \"$@\" \"$output\"\n+\tfi\n+}\n+\n # This is not among top-level (test_expect_success | test_expect_failure)\n # but is a prefix that can be used in the test script, like:\n #\n@@ -493,6 +526,30 @@ test_cmp() {\n \t$GIT_TEST_CMP \"$@\"\n }\n \n+# test_eq_cat is a helper function to compare a 1 word file\n+# with a string.\n+# It almost the same as: test foo = $(cat bar)\n+# for: test_eq_cat foo bar\n+#\n+# However it works when core.autocrlf = true.\n+\n+test_eq_cat() {\n+\ttest \"$1\" = \"$(tr '\\015' '\\012' < \"$2\")\"\n+}\n+\n+# the but not-equal -- may not catch all cases\n+\n+test_ne_cat() {\n+\ttest \"$1\" != \"$(tr '\\015' '\\012' < \"$2\")\"\n+}\n+\n+# the same as test_eq_cat, but file is 1st.\n+\n+test_cat_eq() {\n+\ttest \"$(tr '\\015' '\\012' < \"$1\")\" = \"$2\"\n+}\n+\n+\n # Most tests can use the created repository, but some may need to create more.\n # Usage: test_create_repo <directory>\n test_create_repo () {\n-- \n1.6.3.15.g49878\n"},{"id":"113576","messageId":"1242070141-2936-4-git-send-email-Don.Slutz@SierraAtlantic.com","threadId":"19301","inReplyTo":"1242070141-2936-3-git-send-email-Don.Slutz@SierraAtlantic.com","subject":"[PATCH 3/6] Fix tests to work with core.autocrlf=true","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-11T19:28:58Z","receivedAt":"2009-05-11T19:28:58Z","isPatch":true,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"Use the new functions to fix tests.\n\nSigned-off-by: Don Slutz <Don.Slutz@SierraAtlantic.com>\n---\n t/t0002-gitfile.sh                        |    3 +-\n t/t2004-checkout-cache-temp.sh            |   42 ++++++++++++++--------------\n t/t2008-checkout-subdir.sh                |   14 +++++-----\n t/t3404-rebase-interactive.sh             |    2 +-\n t/t3410-rebase-preserve-dropped-merges.sh |   12 ++++----\n t/t3413-rebase-hook.sh                    |   32 +++++++++++-----------\n t/t3503-cherry-pick-root.sh               |    2 +-\n t/t3903-stash.sh                          |   12 ++++----\n t/t4102-apply-rename.sh                   |    5 ++-\n t/t4124-apply-ws-rule.sh                  |   23 ++++++++++++---\n t/t4125-apply-ws-fuzz.sh                  |    9 +++++-\n t/t4128-apply-root.sh                     |    8 +++---\n t/t4150-am.sh                             |    4 +-\n t/t4252-am-options.sh                     |   16 ++++++++---\n t/t5000-tar-tree.sh                       |   12 +++++---\n t/t5001-archive-attr.sh                   |    3 ++\n t/t5520-pull.sh                           |   12 ++++----\n t/t7003-filter-branch.sh                  |    4 +-\n t/t7201-co.sh                             |    2 +-\n t/t7402-submodule-rebase.sh               |    4 +-\n t/t7610-mergetool.sh                      |    6 ++--\n t/t7800-difftool.sh                       |   13 +++++----\n t/t9700-perl-git.sh                       |    2 +-\n 23 files changed, 139 insertions(+), 103 deletions(-)\n\ndiff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh\nindex cb14425..3762714 100755\n--- a/t/t0002-gitfile.sh\n+++ b/t/t0002-gitfile.sh\n@@ -60,7 +60,8 @@ test_expect_success 'final setup + check rev-parse --git-dir' '\n \n test_expect_success 'check hash-object' '\n \techo \"foo\" >bar &&\n-\tSHA=$(cat bar | git hash-object -w --stdin) &&\n+\tSHA=$(cat bar | git hash-object -w --stdin --path=bar) &&\n+\ttest_debug \"echo SHA=$SHA\" &&\n \tobjck $SHA\n '\n \ndiff --git a/t/t2004-checkout-cache-temp.sh b/t/t2004-checkout-cache-temp.sh\nindex 36cca14..ce4c584 100755\n--- a/t/t2004-checkout-cache-temp.sh\n+++ b/t/t2004-checkout-cache-temp.sh\n@@ -44,7 +44,7 @@ test $(wc -l <out) = 1 &&\n test $(cut \"-d\t\" -f2 out) = path1 &&\n p=$(cut \"-d\t\" -f1 out) &&\n test -f $p &&\n-test $(cat $p) = tree1path1'\n+test_cat_eq $p tree1path1'\n \n test_expect_success \\\n 'checkout all stage 0 to temporary files' '\n@@ -57,7 +57,7 @@ do\n \ttest $(grep $f out | cut \"-d\t\" -f2) = $f &&\n \tp=$(grep $f out | cut \"-d\t\" -f1) &&\n \ttest -f $p &&\n-\ttest $(cat $p) = tree1$f\n+\ttest_cat_eq $p tree1$f\n done'\n \n test_expect_success \\\n@@ -73,7 +73,7 @@ test $(wc -l <out) = 1 &&\n test $(cut \"-d\t\" -f2 out) = path1 &&\n p=$(cut \"-d\t\" -f1 out) &&\n test -f $p &&\n-test $(cat $p) = tree2path1'\n+test_cat_eq $p tree2path1'\n \n test_expect_success \\\n 'checkout all stage 2 to temporary files' '\n@@ -85,7 +85,7 @@ do\n \ttest $(grep $f out | cut \"-d\t\" -f2) = $f &&\n \tp=$(grep $f out | cut \"-d\t\" -f1) &&\n \ttest -f $p &&\n-\ttest $(cat $p) = tree2$f\n+\ttest_cat_eq $p tree2$f\n done'\n \n test_expect_success \\\n@@ -104,9 +104,9 @@ cut \"-d\t\" -f1 out | (read s1 s2 s3 &&\n test -f $s1 &&\n test -f $s2 &&\n test -f $s3 &&\n-test $(cat $s1) = tree1path1 &&\n-test $(cat $s2) = tree2path1 &&\n-test $(cat $s3) = tree3path1)'\n+test_cat_eq $s1 tree1path1 &&\n+test_cat_eq $s2 tree2path1 &&\n+test_cat_eq $s3 tree3path1)'\n \n test_expect_success \\\n 'checkout some stages/one file to temporary files' '\n@@ -118,8 +118,8 @@ cut \"-d\t\" -f1 out | (read s1 s2 s3 &&\n test $s1 = . &&\n test -f $s2 &&\n test -f $s3 &&\n-test $(cat $s2) = tree2path2 &&\n-test $(cat $s3) = tree3path2)'\n+test_cat_eq $s2 tree2path2 &&\n+test_cat_eq $s3 tree3path2)'\n \n test_expect_success \\\n 'checkout all stages/all files to temporary files' '\n@@ -138,9 +138,9 @@ grep path1 out | cut \"-d\t\" -f1 | (read s1 s2 s3 &&\n test -f $s1 &&\n test -f $s2 &&\n test -f $s3 &&\n-test $(cat $s1) = tree1path1 &&\n-test $(cat $s2) = tree2path1 &&\n-test $(cat $s3) = tree3path1)'\n+test_cat_eq $s1 tree1path1 &&\n+test_cat_eq $s2 tree2path1 &&\n+test_cat_eq $s3 tree3path1)'\n \n test_expect_success \\\n '-- path2: no stage 1, have stage 2 and 3' '\n@@ -149,8 +149,8 @@ grep path2 out | cut \"-d\t\" -f1 | (read s1 s2 s3 &&\n test $s1 = . &&\n test -f $s2 &&\n test -f $s3 &&\n-test $(cat $s2) = tree2path2 &&\n-test $(cat $s3) = tree3path2)'\n+test_cat_eq $s2 tree2path2 &&\n+test_cat_eq $s3 tree3path2)'\n \n test_expect_success \\\n '-- path3: no stage 2, have stage 1 and 3' '\n@@ -159,8 +159,8 @@ grep path3 out | cut \"-d\t\" -f1 | (read s1 s2 s3 &&\n test -f $s1 &&\n test $s2 = . &&\n test -f $s3 &&\n-test $(cat $s1) = tree1path3 &&\n-test $(cat $s3) = tree3path3)'\n+test_cat_eq $s1 tree1path3 &&\n+test_cat_eq $s3 tree3path3)'\n \n test_expect_success \\\n '-- path4: no stage 3, have stage 1 and 3' '\n@@ -169,8 +169,8 @@ grep path4 out | cut \"-d\t\" -f1 | (read s1 s2 s3 &&\n test -f $s1 &&\n test -f $s2 &&\n test $s3 = . &&\n-test $(cat $s1) = tree1path4 &&\n-test $(cat $s2) = tree2path4)'\n+test_cat_eq $s1 tree1path4 &&\n+test_cat_eq $s2 tree2path4)'\n \n test_expect_success \\\n '-- asubdir/path5: no stage 2 and 3 have stage 1' '\n@@ -179,7 +179,7 @@ grep asubdir/path5 out | cut \"-d\t\" -f1 | (read s1 s2 s3 &&\n test -f $s1 &&\n test $s2 = . &&\n test $s3 = . &&\n-test $(cat $s1) = tree1asubdir/path5)'\n+test_cat_eq $s1 tree1asubdir/path5)'\n \n test_expect_success \\\n 'checkout --temp within subdir' '\n@@ -191,7 +191,7 @@ test_expect_success \\\n  test -f ../$s1 &&\n  test $s2 = . &&\n  test $s3 = . &&\n- test $(cat ../$s1) = tree1asubdir/path5)\n+ test_cat_eq ../$s1 tree1asubdir/path5)\n )'\n \n test_expect_success SYMLINKS \\\n@@ -207,6 +207,6 @@ test $(wc -l <out) = 1 &&\n test $(cut \"-d\t\" -f2 out) = a &&\n p=$(cut \"-d\t\" -f1 out) &&\n test -f $p &&\n-test $(cat $p) = b'\n+test_cat_eq $p b'\n \n test_done\ndiff --git a/t/t2008-checkout-subdir.sh b/t/t2008-checkout-subdir.sh\nindex 3e098ab..7933197 100755\n--- a/t/t2008-checkout-subdir.sh\n+++ b/t/t2008-checkout-subdir.sh\n@@ -27,14 +27,14 @@ test_expect_success 'remove and restore with relative path' '\n \t\tcd dir1 &&\n \t\trm ../file0 &&\n \t\tgit checkout HEAD -- ../file0 &&\n-\t\ttest \"base\" = \"$(cat ../file0)\" &&\n+\t\ttest_eq_cat base ../file0 &&\n \t\trm ../dir2/file2 &&\n \t\tgit checkout HEAD -- ../dir2/file2 &&\n-\t\ttest \"bonjour\" = \"$(cat ../dir2/file2)\" &&\n+\t\ttest_eq_cat bonjour ../dir2/file2 &&\n \t\trm ../file0 ./file1 &&\n \t\tgit checkout HEAD -- .. &&\n-\t\ttest \"base\" = \"$(cat ../file0)\" &&\n-\t\ttest \"hello\" = \"$(cat file1)\"\n+\t\ttest_eq_cat base ../file0 &&\n+\t\ttest_eq_cat hello file1\n \t)\n \n '\n@@ -43,7 +43,7 @@ test_expect_success 'checkout with empty prefix' '\n \n \trm file0 &&\n \tgit checkout HEAD -- file0 &&\n-\ttest \"base\" = \"$(cat file0)\"\n+\ttest_eq_cat base file0\n \n '\n \n@@ -51,10 +51,10 @@ test_expect_success 'checkout with simple prefix' '\n \n \trm dir1/file1 &&\n \tgit checkout HEAD -- dir1 &&\n-\ttest \"hello\" = \"$(cat dir1/file1)\" &&\n+\ttest_eq_cat hello dir1/file1 &&\n \trm dir1/file1 &&\n \tgit checkout HEAD -- dir1/file1 &&\n-\ttest \"hello\" = \"$(cat dir1/file1)\"\n+\ttest_eq_cat hello dir1/file1\n \n '\n \ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex c32ff66..6990c77 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -162,7 +162,7 @@ test_expect_success 'squash' '\n \tGIT_AUTHOR_NAME=\"Nitfol\" git commit -m \"nitfol\" file7 &&\n \techo \"******************************\" &&\n \tFAKE_LINES=\"1 squash 2\" git rebase -i --onto master HEAD~2 &&\n-\ttest B = $(cat file7) &&\n+\ttest_eq_cat B file7 &&\n \ttest $(git rev-parse HEAD^) = $(git rev-parse master)\n '\n \ndiff --git a/t/t3410-rebase-preserve-dropped-merges.sh b/t/t3410-rebase-preserve-dropped-merges.sh\nindex c49143a..a044962 100755\n--- a/t/t3410-rebase-preserve-dropped-merges.sh\n+++ b/t/t3410-rebase-preserve-dropped-merges.sh\n@@ -52,9 +52,9 @@ test_expect_success 'skip same-resolution merges with -p' '\n \ttest_commit K file7 file7 &&\n \tgit rebase -i -p L &&\n \ttest $(git rev-parse HEAD^^) = $(git rev-parse L) &&\n-\ttest \"23\" = \"$(cat file1)\" &&\n-\ttest \"I\" = \"$(cat file6)\" &&\n-\ttest \"file7\" = \"$(cat file7)\"\n+\ttest_eq_cat 23 file1 &&\n+\ttest_eq_cat I file6 &&\n+\ttest_eq_cat file7 file7\n '\n \n # A - B - C - D - E\n@@ -77,9 +77,9 @@ test_expect_success 'keep different-resolution merges with -p' '\n \tgit add file1 &&\n \tgit rebase --continue &&\n \ttest $(git rev-parse HEAD^^^) = $(git rev-parse L2) &&\n-\ttest \"234\" = \"$(cat file1)\" &&\n-\ttest \"I\" = \"$(cat file6)\" &&\n-\ttest \"file7\" = \"$(cat file7)\"\n+\ttest_eq_cat 234 file1 &&\n+\ttest_eq_cat I file6 &&\n+\ttest_eq_cat file7 file7\n '\n \n test_done\ndiff --git a/t/t3413-rebase-hook.sh b/t/t3413-rebase-hook.sh\nindex 098b755..ac9ad05 100755\n--- a/t/t3413-rebase-hook.sh\n+++ b/t/t3413-rebase-hook.sh\n@@ -27,14 +27,14 @@ test_expect_success 'rebase' '\n \tgit checkout test &&\n \tgit reset --hard side &&\n \tgit rebase master &&\n-\ttest \"z$(cat git)\" = zworld\n+\ttest_cat_eq git world\n '\n \n test_expect_success 'rebase -i' '\n \tgit checkout test &&\n \tgit reset --hard side &&\n \tEDITOR=true git rebase -i master &&\n-\ttest \"z$(cat git)\" = zworld\n+\ttest_cat_eq git world\n '\n \n test_expect_success 'setup pre-rebase hook' '\n@@ -50,8 +50,8 @@ test_expect_success 'pre-rebase hook gets correct input (1)' '\n \tgit checkout test &&\n \tgit reset --hard side &&\n \tgit rebase master &&\n-\ttest \"z$(cat git)\" = zworld &&\n-\ttest \"z$(cat .git/PRE-REBASE-INPUT)\" = zmaster,\n+\ttest_cat_eq git world &&\n+\ttest_cat_eq .git/PRE-REBASE-INPUT master,\n \n '\n \n@@ -59,8 +59,8 @@ test_expect_success 'pre-rebase hook gets correct input (2)' '\n \tgit checkout test &&\n \tgit reset --hard side &&\n \tgit rebase master test &&\n-\ttest \"z$(cat git)\" = zworld &&\n-\ttest \"z$(cat .git/PRE-REBASE-INPUT)\" = zmaster,test\n+\ttest_cat_eq git world &&\n+\ttest_cat_eq .git/PRE-REBASE-INPUT master,test\n '\n \n test_expect_success 'pre-rebase hook gets correct input (3)' '\n@@ -68,16 +68,16 @@ test_expect_success 'pre-rebase hook gets correct input (3)' '\n \tgit reset --hard side &&\n \tgit checkout master &&\n \tgit rebase master test &&\n-\ttest \"z$(cat git)\" = zworld &&\n-\ttest \"z$(cat .git/PRE-REBASE-INPUT)\" = zmaster,test\n+\ttest_cat_eq git world &&\n+\ttest_cat_eq .git/PRE-REBASE-INPUT master,test\n '\n \n test_expect_success 'pre-rebase hook gets correct input (4)' '\n \tgit checkout test &&\n \tgit reset --hard side &&\n \tEDITOR=true git rebase -i master &&\n-\ttest \"z$(cat git)\" = zworld &&\n-\ttest \"z$(cat .git/PRE-REBASE-INPUT)\" = zmaster,\n+\ttest_cat_eq git world &&\n+\ttest_cat_eq .git/PRE-REBASE-INPUT master,\n \n '\n \n@@ -85,8 +85,8 @@ test_expect_success 'pre-rebase hook gets correct input (5)' '\n \tgit checkout test &&\n \tgit reset --hard side &&\n \tEDITOR=true git rebase -i master test &&\n-\ttest \"z$(cat git)\" = zworld &&\n-\ttest \"z$(cat .git/PRE-REBASE-INPUT)\" = zmaster,test\n+\ttest_cat_eq git world &&\n+\ttest_cat_eq .git/PRE-REBASE-INPUT master,test\n '\n \n test_expect_success 'pre-rebase hook gets correct input (6)' '\n@@ -94,8 +94,8 @@ test_expect_success 'pre-rebase hook gets correct input (6)' '\n \tgit reset --hard side &&\n \tgit checkout master &&\n \tEDITOR=true git rebase -i master test &&\n-\ttest \"z$(cat git)\" = zworld &&\n-\ttest \"z$(cat .git/PRE-REBASE-INPUT)\" = zmaster,test\n+\ttest_cat_eq git world &&\n+\ttest_cat_eq .git/PRE-REBASE-INPUT master,test\n '\n \n test_expect_success 'setup pre-rebase hook that fails' '\n@@ -132,7 +132,7 @@ test_expect_success 'rebase --no-verify overrides pre-rebase (1)' '\n \tgit reset --hard side &&\n \tgit rebase --no-verify master &&\n \ttest \"z$(git symbolic-ref HEAD)\" = zrefs/heads/test &&\n-\ttest \"z$(cat git)\" = zworld\n+\ttest_cat_eq git world\n '\n \n test_expect_success 'rebase --no-verify overrides pre-rebase (2)' '\n@@ -140,7 +140,7 @@ test_expect_success 'rebase --no-verify overrides pre-rebase (2)' '\n \tgit reset --hard side &&\n \tEDITOR=true git rebase --no-verify -i master &&\n \ttest \"z$(git symbolic-ref HEAD)\" = zrefs/heads/test &&\n-\ttest \"z$(cat git)\" = zworld\n+\ttest_cat_eq git world\n '\n \n test_done\ndiff --git a/t/t3503-cherry-pick-root.sh b/t/t3503-cherry-pick-root.sh\nindex b0faa29..dfcd72a 100755\n--- a/t/t3503-cherry-pick-root.sh\n+++ b/t/t3503-cherry-pick-root.sh\n@@ -23,7 +23,7 @@ test_expect_success setup '\n test_expect_success 'cherry-pick a root commit' '\n \n \tgit cherry-pick master &&\n-\ttest first = $(cat file1)\n+\ttest_eq_cat first file1\n \n '\n \ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex 7484cbe..7c1e169 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -49,7 +49,7 @@ test_expect_success 'apply stashed changes' '\n \ttest_tick &&\n \tgit commit -m other-file &&\n \tgit stash apply &&\n-\ttest 3 = $(cat file) &&\n+\ttest_eq_cat 3 file &&\n \ttest 1 = $(git show :file) &&\n \ttest 1 = $(git show HEAD:file)\n '\n@@ -61,7 +61,7 @@ test_expect_success 'apply stashed changes (including index)' '\n \ttest_tick &&\n \tgit commit -m other-file &&\n \tgit stash apply --index &&\n-\ttest 3 = $(cat file) &&\n+\ttest_eq_cat 3 file &&\n \ttest 2 = $(git show :file) &&\n \ttest 1 = $(git show HEAD:file)\n '\n@@ -83,7 +83,7 @@ test_expect_success 'drop top stash' '\n \tgit stash list > stashlist2 &&\n \tdiff stashlist1 stashlist2 &&\n \tgit stash apply &&\n-\ttest 3 = $(cat file) &&\n+\ttest_eq_cat 3 file &&\n \ttest 1 = $(git show :file) &&\n \ttest 1 = $(git show HEAD:file)\n '\n@@ -97,13 +97,13 @@ test_expect_success 'drop middle stash' '\n \tgit stash drop stash@{1} &&\n \ttest 2 = $(git stash list | wc -l) &&\n \tgit stash apply &&\n-\ttest 9 = $(cat file) &&\n+\ttest_eq_cat 9 file &&\n \ttest 1 = $(git show :file) &&\n \ttest 1 = $(git show HEAD:file) &&\n \tgit reset --hard &&\n \tgit stash drop &&\n \tgit stash apply &&\n-\ttest 3 = $(cat file) &&\n+\ttest_eq_cat 3 file &&\n \ttest 1 = $(git show :file) &&\n \ttest 1 = $(git show HEAD:file)\n '\n@@ -111,7 +111,7 @@ test_expect_success 'drop middle stash' '\n test_expect_success 'stash pop' '\n \tgit reset --hard &&\n \tgit stash pop &&\n-\ttest 3 = $(cat file) &&\n+\ttest_eq_cat 3 file &&\n \ttest 1 = $(git show :file) &&\n \ttest 1 = $(git show HEAD:file) &&\n \ttest 0 = $(git stash list | wc -l)\ndiff --git a/t/t4102-apply-rename.sh b/t/t4102-apply-rename.sh\nindex 1597965..5c7300d 100755\n--- a/t/t4102-apply-rename.sh\n+++ b/t/t4102-apply-rename.sh\n@@ -43,7 +43,7 @@ test_expect_success FILEMODE validate \\\n \n test_expect_success 'apply reverse' \\\n     'git apply -R --index --stat --summary --apply test-patch &&\n-     test \"$(cat foo)\" = \"This is foo\"'\n+     test_cat_eq foo \"This is foo\"'\n \n cat >test-patch <<\\EOF\n diff --git a/foo b/bar\n@@ -59,6 +59,7 @@ EOF\n \n test_expect_success 'apply copy' \\\n     'git apply --index --stat --summary --apply test-patch &&\n-     test \"$(cat bar)\" = \"This is bar\" -a \"$(cat foo)\" = \"This is foo\"'\n+     test_cat_eq bar \"This is bar\" &&\n+     test_cat_eq foo \"This is foo\"'\n \n test_done\ndiff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh\nindex f83322e..3933dd9 100755\n--- a/t/t4124-apply-ws-rule.sh\n+++ b/t/t4124-apply-ws-rule.sh\n@@ -38,13 +38,19 @@ apply_patch () {\n \tgit apply \"$@\"\n }\n \n+remove_cr () {\n+\ttr '\\015' Q <\"$1\" | sed -e 's/Q$//'\n+}\n+\n test_fix () {\n \n \t# fix should not barf\n \tapply_patch --whitespace=fix || return 1\n \n+\ttest_debug \"echo patch applied: [$1]\"\n \t# find touched lines\n-\tdiff file target | sed -n -e \"s/^> //p\" >fixed\n+\tremove_cr target >target1\n+\tdiff file target1 | sed -n -e \"s/^> //p\" >fixed\n \n \t# the changed lines are all expeced to change\n \tfixed_cnt=$(wc -l <fixed)\n@@ -52,6 +58,7 @@ test_fix () {\n \t'') expect_cnt=$fixed_cnt ;;\n \t?*) expect_cnt=$(grep \"[$1]\" <fixed | wc -l) ;;\n \tesac\n+\ttest_debug \"echo fixed: $fixed_cnt vs $expect_cnt\"\n \ttest $fixed_cnt -eq $expect_cnt || return 1\n \n \t# and we are not missing anything\n@@ -59,12 +66,14 @@ test_fix () {\n \t'') expect_cnt=0 ;;\n \t?*) expect_cnt=$(grep \"[$1]\" <file | wc -l) ;;\n \tesac\n+\ttest_debug \"echo missing: $fixed_cnt vs $expect_cnt\"\n \ttest $fixed_cnt -eq $expect_cnt || return 1\n \n \t# Get the patch actually applied\n \tgit diff-files -p target >fixed-patch\n \ttest -s fixed-patch && return 0\n \n+\ttest_debug \"echo failed to apply, try and fix\"\n \t# Make sure it is complaint-free\n \t>target\n \tgit apply --whitespace=error-all <fixed-patch\n@@ -85,14 +94,16 @@ test_expect_success setup '\n test_expect_success 'whitespace=nowarn, default rule' '\n \n \tapply_patch --whitespace=nowarn &&\n-\tdiff file target\n+\tremove_cr target >target1 &&\n+\tdiff file target1\n \n '\n \n test_expect_success 'whitespace=warn, default rule' '\n \n \tapply_patch --whitespace=warn &&\n-\tdiff file target\n+\tremove_cr target >target1 &&\n+\tdiff file target1\n \n '\n \n@@ -108,7 +119,8 @@ test_expect_success 'whitespace=error-all, no rule' '\n \n \tgit config core.whitespace -trailing,-space-before,-indent &&\n \tapply_patch --whitespace=error-all &&\n-\tdiff file target\n+\tremove_cr target >target1 &&\n+\tdiff file target1\n \n '\n \n@@ -117,7 +129,8 @@ test_expect_success 'whitespace=error-all, no rule (attribute)' '\n \tgit config --unset core.whitespace &&\n \techo \"target -whitespace\" >.gitattributes &&\n \tapply_patch --whitespace=error-all &&\n-\tdiff file target\n+\tremove_cr target >target1 &&\n+\tdiff file target1\n \n '\n \ndiff --git a/t/t4125-apply-ws-fuzz.sh b/t/t4125-apply-ws-fuzz.sh\nindex 3b471b6..c02fe08 100755\n--- a/t/t4125-apply-ws-fuzz.sh\n+++ b/t/t4125-apply-ws-fuzz.sh\n@@ -4,6 +4,10 @@ test_description='applying patch that has broken whitespaces in context'\n \n . ./test-lib.sh\n \n+remove_cr () {\n+\ttr '\\015' Q <\"$1\" | sed -e 's/Q$//'\n+}\n+\n test_expect_success setup '\n \n \t>file &&\n@@ -91,12 +95,13 @@ test_expect_success 'withfix (backward)' '\n \n \tsed -e /h/d file-fixed >fixed-head &&\n \tsed -e /h/d file >file-head &&\n-\ttest_cmp fixed-head file-head &&\n+\tremove_cr file-head >file-head1\n+\tdiff fixed-head file-head1 &&\n \n \tsed -n -e /h/p file-fixed >fixed-tail &&\n \tsed -n -e /h/p file >file-tail &&\n \n-\t! test_cmp fixed-tail file-tail\n+\t! diff fixed-tail file-tail\n \n '\n \ndiff --git a/t/t4128-apply-root.sh b/t/t4128-apply-root.sh\nindex 8f6aea4..a03a9c8 100755\n--- a/t/t4128-apply-root.sh\n+++ b/t/t4128-apply-root.sh\n@@ -27,7 +27,7 @@ test_expect_success 'apply --directory -p (1)' '\n \n \tgit apply --directory=some/sub -p3 --index patch &&\n \ttest Bello = $(git show :some/sub/dir/file) &&\n-\ttest Bello = $(cat some/sub/dir/file)\n+\ttest_eq_cat Bello some/sub/dir/file\n \n '\n \n@@ -36,7 +36,7 @@ test_expect_success 'apply --directory -p (2) ' '\n \tgit reset --hard initial &&\n \tgit apply --directory=some/sub/ -p3 --index patch &&\n \ttest Bello = $(git show :some/sub/dir/file) &&\n-\ttest Bello = $(cat some/sub/dir/file)\n+\ttest_eq_cat Bello some/sub/dir/file\n \n '\n \n@@ -54,7 +54,7 @@ test_expect_success 'apply --directory (new file)' '\n \tgit reset --hard initial &&\n \tgit apply --directory=some/sub/dir/ --index patch &&\n \ttest content = $(git show :some/sub/dir/newfile) &&\n-\ttest content = $(cat some/sub/dir/newfile)\n+\ttest_eq_cat content some/sub/dir/newfile\n '\n \n cat > patch << EOF\n@@ -89,7 +89,7 @@ test_expect_success 'apply --directory (quoted filename)' '\n \tgit reset --hard initial &&\n \tgit apply --directory=some/sub/dir/ --index patch &&\n \ttest content = $(git show :some/sub/dir/quotefile) &&\n-\ttest content = $(cat some/sub/dir/quotefile)\n+\ttest_eq_cat content some/sub/dir/quotefile\n '\n \n test_done\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex d6ebbae..27570b7 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -190,7 +190,7 @@ test_expect_success 'am --skip works' '\n \tgit am --skip &&\n \t! test -d .git/rebase-apply &&\n \ttest -z \"$(git diff lorem2^^ -- file)\" &&\n-\ttest goodbye = \"$(cat another)\"\n+\ttest_eq_cat goodbye another\n '\n \n test_expect_success 'am --resolved works' '\n@@ -201,7 +201,7 @@ test_expect_success 'am --resolved works' '\n \tgit add file &&\n \tgit am --resolved &&\n \t! test -d .git/rebase-apply &&\n-\ttest goodbye = \"$(cat another)\"\n+\ttest_eq_cat goodbye another\n '\n \n test_expect_success 'am takes patches from a Pine mailbox' '\ndiff --git a/t/t4252-am-options.sh b/t/t4252-am-options.sh\nindex f603c1b..342fc1a 100755\n--- a/t/t4252-am-options.sh\n+++ b/t/t4252-am-options.sh\n@@ -3,6 +3,10 @@\n test_description='git am with options and not losing them'\n . ./test-lib.sh\n \n+remove_cr () {\n+\ttr '\\015' Q <\"$1\" | sed -e 's/Q$//'\n+}\n+\n tm=\"$TEST_DIRECTORY/t4252\"\n \n test_expect_success setup '\n@@ -20,7 +24,8 @@ test_expect_success 'interrupted am --whitespace=fix' '\n \ttest_must_fail git am --whitespace=fix \"$tm\"/am-test-1-? &&\n \tgit am --skip &&\n \tgrep 3 file-1 &&\n-\tgrep \"^Six$\" file-2\n+\tremove_cr file-2 >file-2a &&\n+\tgrep \"^Six$\" file-2a\n '\n \n test_expect_success 'interrupted am -C1' '\n@@ -29,7 +34,8 @@ test_expect_success 'interrupted am -C1' '\n \ttest_must_fail git am -C1 \"$tm\"/am-test-2-? &&\n \tgit am --skip &&\n \tgrep 3 file-1 &&\n-\tgrep \"^Three$\" file-2\n+\tremove_cr file-2 >file-2a &&\n+\tgrep \"^Three$\" file-2a\n '\n \n test_expect_success 'interrupted am -p2' '\n@@ -38,7 +44,8 @@ test_expect_success 'interrupted am -p2' '\n \ttest_must_fail git am -p2 \"$tm\"/am-test-3-? &&\n \tgit am --skip &&\n \tgrep 3 file-1 &&\n-\tgrep \"^Three$\" file-2\n+\tremove_cr file-2 >file-2a &&\n+\tgrep \"^Three$\" file-2a\n '\n \n test_expect_success 'interrupted am -C1 -p2' '\n@@ -47,7 +54,8 @@ test_expect_success 'interrupted am -C1 -p2' '\n \ttest_must_fail git am -p2 -C1 \"$tm\"/am-test-4-? &&\n \tgit am --skip &&\n \tgrep 3 file-1 &&\n-\tgrep \"^Three$\" file-2\n+\tremove_cr file-2 >file-2a &&\n+\tgrep \"^Three$\" file-2a\n '\n \n test_expect_success 'interrupted am --directory=\"frotz nitfol\"' '\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex abb41b0..28d6291 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -25,6 +25,8 @@ commit id embedding:\n '\n \n . ./test-lib.sh\n+autocrlf=$(git config core.autocrlf)\n+\n UNZIP=${UNZIP:-unzip}\n \n SUBSTFORMAT=%H%n\n@@ -66,6 +68,8 @@ test_expect_success \\\n     'git clone --bare . bare.git &&\n      cp .git/info/attributes bare.git/info/attributes'\n \n+test ! -z \"$autocrlf\" && (cd bare.git; git config core.autocrlf $autocrlf)\n+\n test_expect_success \\\n     'remove ignored file' \\\n     'rm a/ignored'\n@@ -118,7 +122,7 @@ test_expect_success \\\n \n test_expect_success \\\n     'validate file contents' \\\n-    'diff -r a b/a'\n+    'diff -rb a b/a'\n \n test_expect_success \\\n     'git tar-tree with prefix' \\\n@@ -135,7 +139,7 @@ test_expect_success \\\n \n test_expect_success \\\n     'validate file contents with prefix' \\\n-    'diff -r a c/prefix/a'\n+    'diff -rb a c/prefix/a'\n \n test_expect_success \\\n     'create archives with substfiles' \\\n@@ -203,7 +207,7 @@ test_expect_success UNZIP \\\n \n test_expect_success UNZIP \\\n     'validate file contents' \\\n-    'diff -r a d/a'\n+    'diff -rb a d/a'\n \n test_expect_success \\\n     'git archive --format=zip with prefix' \\\n@@ -220,7 +224,7 @@ test_expect_success UNZIP \\\n \n test_expect_success UNZIP \\\n     'validate file contents with prefix' \\\n-    'diff -r a e/prefix/a'\n+    'diff -rb a e/prefix/a'\n \n test_expect_success \\\n     'git archive --list outside of a git repo' \\\ndiff --git a/t/t5001-archive-attr.sh b/t/t5001-archive-attr.sh\nindex 426b319..2efa018 100755\n--- a/t/t5001-archive-attr.sh\n+++ b/t/t5001-archive-attr.sh\n@@ -3,6 +3,7 @@\n test_description='git archive attribute tests'\n \n . ./test-lib.sh\n+autocrlf=$(git config core.autocrlf)\n \n SUBSTFORMAT=%H%n\n \n@@ -39,6 +40,8 @@ test_expect_success 'setup' '\n \tcp .git/info/attributes bare/info/attributes\n '\n \n+test ! -z \"$autocrlf\" && (cd bare; git config core.autocrlf $autocrlf)\n+\n test_expect_success 'git archive' '\n \tgit archive HEAD >archive.tar &&\n \t(mkdir archive && cd archive && \"$TAR\" xf -) <archive.tar\ndiff --git a/t/t5520-pull.sh b/t/t5520-pull.sh\nindex 725771f..4d4e7ac 100755\n--- a/t/t5520-pull.sh\n+++ b/t/t5520-pull.sh\n@@ -49,9 +49,9 @@ test_expect_success 'test . as a remote' '\n \techo updated >file &&\n \tgit commit -a -m updated &&\n \tgit checkout copy &&\n-\ttest `cat file` = file &&\n+\ttest_cat_eq file file &&\n \tgit pull &&\n-\ttest `cat file` = updated\n+\ttest_cat_eq file updated\n '\n \n test_expect_success 'the default remote . should not break explicit pull' '\n@@ -60,9 +60,9 @@ test_expect_success 'the default remote . should not break explicit pull' '\n \tgit commit -a -m modified &&\n \tgit checkout copy &&\n \tgit reset --hard HEAD^ &&\n-\ttest `cat file` = file &&\n+\ttest_cat_eq file file &&\n \tgit pull . second &&\n-\ttest `cat file` = modified\n+\ttest_cat_eq file modified\n '\n \n test_expect_success '--rebase' '\n@@ -99,8 +99,8 @@ test_expect_success '--rebase with rebased upstream' '\n \techo file > file2 &&\n \tgit commit -m to-rebase file2 &&\n \tgit pull --rebase me copy &&\n-\ttest \"conflicting modification\" = \"$(cat file)\" &&\n-\ttest file = $(cat file2)\n+\ttest_eq_cat \"conflicting modification\" file &&\n+\ttest_eq_cat file file2\n \n '\n \ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex 329c851..c6e9fb5 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -72,7 +72,7 @@ test_expect_success 'test that the file was renamed' '\n \ttest d = \"$(git show HEAD:doh --)\" &&\n \t! test -f d &&\n \ttest -f doh &&\n-\ttest d = \"$(cat doh)\"\n+\ttest_eq_cat d doh\n '\n \n test_expect_success 'rewrite, renaming a specific directory' '\n@@ -85,7 +85,7 @@ test_expect_success 'test that the directory was renamed' '\n \ttest -d diroh &&\n \t! test -d diroh/dir &&\n \ttest -f diroh/d &&\n-\ttest dir/d = \"$(cat diroh/d)\"\n+\ttest_eq_cat dir/d diroh/d\n '\n \n git tag oldD HEAD~4\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex bdb808a..62f58eb 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -434,7 +434,7 @@ test_expect_success 'checkout unmerged stage' '\n \ttest_cmp expect filf &&\n \ttest_cmp expect file &&\n \tgit checkout --theirs file &&\n-\ttest ztheirside = \"z$(cat file)\"\n+\ttest_eq_cat theirside file\n '\n \n test_expect_success 'checkout with --merge' '\ndiff --git a/t/t7402-submodule-rebase.sh b/t/t7402-submodule-rebase.sh\nindex f919c8d..8e5d747 100755\n--- a/t/t7402-submodule-rebase.sh\n+++ b/t/t7402-submodule-rebase.sh\n@@ -80,11 +80,11 @@ test_expect_success 'stash with a dirty submodule' '\n \techo new > file &&\n \tCURRENT=$(cd submodule && git rev-parse HEAD) &&\n \tgit stash &&\n-\ttest new != $(cat file) &&\n+\ttest_ne_cat new file &&\n \ttest submodule = $(git diff --name-only) &&\n \ttest $CURRENT = $(cd submodule && git rev-parse HEAD) &&\n \tgit stash apply &&\n-\ttest new = $(cat file) &&\n+\ttest_eq_cat new file &&\n \ttest $CURRENT = $(cd submodule && git rev-parse HEAD)\n \n '\ndiff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh\nindex e768c3e..bf39e45 100755\n--- a/t/t7610-mergetool.sh\n+++ b/t/t7610-mergetool.sh\n@@ -45,9 +45,9 @@ test_expect_success 'custom mergetool' '\n     ( yes \"\" | git mergetool file1 >/dev/null 2>&1 ) &&\n     ( yes \"\" | git mergetool file2 >/dev/null 2>&1 ) &&\n     ( yes \"\" | git mergetool subdir/file3 >/dev/null 2>&1 ) &&\n-    test \"$(cat file1)\" = \"master updated\" &&\n-    test \"$(cat file2)\" = \"master new\" &&\n-    test \"$(cat subdir/file3)\" = \"master new sub\" &&\n+    test_cat_eq file1 \"master updated\" &&\n+    test_cat_eq file2 \"master new\" &&\n+    test_cat_eq subdir/file3 \"master new sub\" &&\n     git commit -m \"branch1 resolved with mergetool\"\n '\n \ndiff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh\nindex ebdccf9..b95069a 100755\n--- a/t/t7800-difftool.sh\n+++ b/t/t7800-difftool.sh\n@@ -35,11 +35,12 @@ restore_test_defaults()\n \tunset GIT_DIFFTOOL_PROMPT\n \tunset GIT_DIFFTOOL_NO_PROMPT\n \tgit config diff.tool test-tool &&\n-\tgit config difftool.test-tool.cmd 'cat $LOCAL'\n+\tgit config difftool.test-tool.cmd \"tr '\\015' '\\012' <\\$LOCAL\"\n }\n \n prompt_given()\n {\n+\ttest_debug \"echo prompt_given:$1\"\n \tprompt=\"$1\"\n \ttest \"$prompt\" = \"Hit return to launch 'test-tool': branch\"\n }\n@@ -59,7 +60,7 @@ test_expect_success 'setup' '\n # Configure a custom difftool.<tool>.cmd and use it\n test_expect_success 'custom commands' '\n \trestore_test_defaults &&\n-\tgit config difftool.test-tool.cmd \"cat \\$REMOTE\" &&\n+\tgit config difftool.test-tool.cmd \"tr '\\''\\015'\\'' '\\''\\012'\\'' <\\$REMOTE\" &&\n \n \tdiff=$(git difftool --no-prompt branch) &&\n \ttest \"$diff\" = \"master\" &&\n@@ -136,7 +137,7 @@ test_expect_success 'GIT_DIFFTOOL_PROMPT variable' '\n \tGIT_DIFFTOOL_PROMPT=true &&\n \texport GIT_DIFFTOOL_PROMPT &&\n \n-\tprompt=$(echo | git difftool --prompt branch | tail -1) &&\n+\tprompt=$(echo | git difftool --prompt branch | head -3 | tail -1) &&\n \tprompt_given \"$prompt\" &&\n \n \trestore_test_defaults\n@@ -166,7 +167,7 @@ test_expect_success 'difftool.prompt can overridden with -y' '\n test_expect_success 'difftool.prompt can overridden with --prompt' '\n \tgit config difftool.prompt false &&\n \n-\tprompt=$(echo | git difftool --prompt branch | tail -1) &&\n+\tprompt=$(echo | git difftool --prompt branch | head -3 | tail -1) &&\n \tprompt_given \"$prompt\" &&\n \n \trestore_test_defaults\n@@ -179,7 +180,7 @@ test_expect_success 'difftool last flag wins' '\n \n \trestore_test_defaults &&\n \n-\tprompt=$(echo | git difftool --no-prompt --prompt branch | tail -1) &&\n+\tprompt=$(echo | git difftool --no-prompt --prompt branch | head -3 | tail -1) &&\n \tprompt_given \"$prompt\" &&\n \n \trestore_test_defaults\n@@ -190,7 +191,7 @@ test_expect_success 'difftool last flag wins' '\n test_expect_success 'difftool + mergetool config variables' '\n \tremove_config_vars\n \tgit config merge.tool test-tool &&\n-\tgit config mergetool.test-tool.cmd \"cat \\$LOCAL\" &&\n+\tgit config mergetool.test-tool.cmd \"tr '\\''\\015'\\'' '\\''\\012'\\'' <\\$LOCAL\" &&\n \n \tdiff=$(git difftool --no-prompt branch) &&\n \ttest \"$diff\" = \"branch\" &&\ndiff --git a/t/t9700-perl-git.sh b/t/t9700-perl-git.sh\nindex b4ca244..76f741f 100755\n--- a/t/t9700-perl-git.sh\n+++ b/t/t9700-perl-git.sh\n@@ -42,7 +42,7 @@ test_expect_success \\\n      git config --add test.int 2k\n      '\n \n-test_external_without_stderr \\\n+test_external_with_only_warning \\\n     'Perl API' \\\n     perl \"$TEST_DIRECTORY\"/t9700/test.pl\n \n-- \n1.6.3.15.g49878\n"},{"id":"113572","messageId":"1242070141-2936-5-git-send-email-Don.Slutz@SierraAtlantic.com","threadId":"19301","inReplyTo":"1242070141-2936-4-git-send-email-Don.Slutz@SierraAtlantic.com","subject":"[PATCH 4/6] Fix tests to work with core.autocrlf=true","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-11T19:28:59Z","receivedAt":"2009-05-11T19:28:59Z","isPatch":true,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"Force core.autocrlf=false for these tests.  Most of these tests are checking\nfor whitespace differences and so are not simple to fix.  The rest are not\nclear how to fix.\n\nSigned-off-by: Don Slutz <Don.Slutz@SierraAtlantic.com>\n---\n t/t1002-read-tree-m-u-2way.sh |    3 ++-\n t/t4015-diff-whitespace.sh    |    2 ++\n t/t4019-diff-wserror.sh       |    1 +\n t/t4116-apply-reverse.sh      |    1 +\n t/t4200-rerere.sh             |    2 ++\n 5 files changed, 8 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh\nindex 5e40cec..acc9474 100755\n--- a/t/t1002-read-tree-m-u-2way.sh\n+++ b/t/t1002-read-tree-m-u-2way.sh\n@@ -37,7 +37,8 @@ check_cache_at () {\n \n test_expect_success \\\n     setup \\\n-    'echo frotz >frotz &&\n+    'git config core.autocrlf false &&\n+     echo frotz >frotz &&\n      echo nitfol >nitfol &&\n      echo bozbar >bozbar &&\n      echo rezrov >rezrov &&\ndiff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh\nindex 6d13da3..122557e 100755\n--- a/t/t4015-diff-whitespace.sh\n+++ b/t/t4015-diff-whitespace.sh\n@@ -9,6 +9,8 @@ test_description='Test special whitespace in diff engine.\n . ./test-lib.sh\n . \"$TEST_DIRECTORY\"/diff-lib.sh\n \n+test_expect_success \"setup\" 'git config core.autocrlf false'\n+\n # Ray Lehtiniemi's example\n \n cat << EOF > x\ndiff --git a/t/t4019-diff-wserror.sh b/t/t4019-diff-wserror.sh\nindex 84a1fe3..a580403 100755\n--- a/t/t4019-diff-wserror.sh\n+++ b/t/t4019-diff-wserror.sh\n@@ -6,6 +6,7 @@ test_description='diff whitespace error detection'\n \n test_expect_success setup '\n \n+\tgit config core.autocrlf false &&\n \tgit config diff.color.whitespace \"blue reverse\" &&\n \t>F &&\n \tgit add F &&\ndiff --git a/t/t4116-apply-reverse.sh b/t/t4116-apply-reverse.sh\nindex 2298ece..a846be6 100755\n--- a/t/t4116-apply-reverse.sh\n+++ b/t/t4116-apply-reverse.sh\n@@ -11,6 +11,7 @@ test_description='git apply in reverse\n \n test_expect_success setup '\n \n+\tgit config core.autocrlf false &&\n \tfor i in a b c d e f g h i j k l m n; do echo $i; done >file1 &&\n \tperl -pe \"y/ijk/\\\\000\\\\001\\\\002/\" <file1 >file2 &&\n \ndiff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh\nindex a6bc028..5e6cc82 100755\n--- a/t/t4200-rerere.sh\n+++ b/t/t4200-rerere.sh\n@@ -8,6 +8,8 @@ test_description='git rerere\n \n . ./test-lib.sh\n \n+git config core.autocrlf false\n+\n cat > a1 << EOF\n Some title\n ==========\n-- \n1.6.3.15.g49878\n"},{"id":"113573","messageId":"1242070141-2936-6-git-send-email-Don.Slutz@SierraAtlantic.com","threadId":"19301","inReplyTo":"1242070141-2936-5-git-send-email-Don.Slutz@SierraAtlantic.com","subject":"[PATCH 5/6] Fix tests to work with core.autocrlf=true","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-11T19:29:00Z","receivedAt":"2009-05-11T19:29:00Z","isPatch":true,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"Switch from using cmp to using test_cmp in these tests.\n\nSigned-off-by: Don Slutz <Don.Slutz@SierraAtlantic.com>\n---\n t/t0021-conversion.sh        |   12 ++++++------\n t/t1020-subdirectory.sh      |   12 ++++++------\n t/t4127-apply-same-fn.sh     |    2 +-\n t/t6021-merge-criss-cross.sh |    2 +-\n t/t6026-merge-attr.sh        |   10 +++++-----\n 5 files changed, 19 insertions(+), 19 deletions(-)\n\ndiff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh\nindex 8fc39d7..7a6d8c7 100755\n--- a/t/t0021-conversion.sh\n+++ b/t/t0021-conversion.sh\n@@ -33,17 +33,17 @@ test_expect_success setup '\n \tgit checkout -- test test.t test.i\n '\n \n-script='s/^\\$Id: \\([0-9a-f]*\\) \\$/\\1/p'\n-\n test_expect_success check '\n \n-\tcmp test.o test &&\n-\tcmp test.o test.t &&\n+\ttest_cmp test.o test &&\n+\ttest_cmp test.o test.t &&\n \n \t# ident should be stripped in the repository\n \tgit diff --raw --exit-code :test :test.i &&\n \tid=$(git rev-parse --verify :test) &&\n-\tembedded=$(sed -ne \"$script\" test.i) &&\n+\ttest_debug \"echo id=$id\"\n+\tembedded=$(grep Id: test.i | cut -d\\  -f2) &&\n+\ttest_debug \"echo embedded=$embedded\"\n \ttest \"z$id\" = \"z$embedded\" &&\n \n \tgit cat-file blob :test.t > test.r &&\n@@ -85,7 +85,7 @@ test_expect_success expanded_in_repo '\n \trm -f expanded-keywords &&\n \tgit checkout -- expanded-keywords &&\n \tcat expanded-keywords &&\n-\tcmp expanded-keywords expected-output\n+\ttest_cmp expanded-keywords expected-output\n '\n \n test_done\ndiff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh\nindex 210e594..ce67e6c 100755\n--- a/t/t1020-subdirectory.sh\n+++ b/t/t1020-subdirectory.sh\n@@ -86,10 +86,10 @@ test_expect_success 'write-tree' '\n test_expect_success 'checkout-index' '\n \tcd \"$HERE\" &&\n \tgit checkout-index -f -u one &&\n-\tcmp one original.one &&\n+\ttest_cmp one original.one &&\n \tcd dir &&\n \tgit checkout-index -f -u two &&\n-\tcmp two ../original.two\n+\ttest_cmp two ../original.two\n '\n \n test_expect_success 'read-tree' '\n@@ -97,13 +97,13 @@ test_expect_success 'read-tree' '\n \trm -f one dir/two &&\n \ttree=`git write-tree` &&\n \tgit read-tree --reset -u \"$tree\" &&\n-\tcmp one original.one &&\n-\tcmp dir/two original.two &&\n+\ttest_cmp one original.one &&\n+\ttest_cmp dir/two original.two &&\n \tcd dir &&\n \trm -f two &&\n \tgit read-tree --reset -u \"$tree\" &&\n-\tcmp two ../original.two &&\n-\tcmp ../one ../original.one\n+\ttest_cmp two ../original.two &&\n+\ttest_cmp ../one ../original.one\n '\n \n test_expect_success 'no file/rev ambiguity check inside .git' '\ndiff --git a/t/t4127-apply-same-fn.sh b/t/t4127-apply-same-fn.sh\nindex 3a8202e..66b774f 100755\n--- a/t/t4127-apply-same-fn.sh\n+++ b/t/t4127-apply-same-fn.sh\n@@ -27,7 +27,7 @@ test_expect_success 'apply same filename with independent changes' '\n \tcp same_fn same_fn2 &&\n \tgit reset --hard &&\n \tgit apply patch0 &&\n-\tdiff same_fn same_fn2\n+\ttest_cmp same_fn same_fn2\n '\n \n test_expect_success 'apply same filename with overlapping changes' '\ndiff --git a/t/t6021-merge-criss-cross.sh b/t/t6021-merge-criss-cross.sh\nindex 331b9b0..53fdfd8 100755\n--- a/t/t6021-merge-criss-cross.sh\n+++ b/t/t6021-merge-criss-cross.sh\n@@ -87,7 +87,7 @@ cat > file-expect <<EOF\n 9\n EOF\n \n-test_expect_success 'Criss-cross merge result' 'cmp file file-expect'\n+test_expect_success 'Criss-cross merge result' 'test_cmp file file-expect'\n \n test_expect_success 'Criss-cross merge fails (-s resolve)' \\\n 'git reset --hard A^ &&\ndiff --git a/t/t6026-merge-attr.sh b/t/t6026-merge-attr.sh\nindex 1ba0a25..0b57c68 100755\n--- a/t/t6026-merge-attr.sh\n+++ b/t/t6026-merge-attr.sh\n@@ -63,7 +63,7 @@ test_expect_success 'check merge result in working tree' '\n \n \tgit cat-file -p HEAD:binary >binary-orig &&\n \tgrep \"<<<<<<<\" text &&\n-\tcmp binary-orig binary &&\n+\ttest_cmp binary-orig binary &&\n \t! grep \"<<<<<<<\" union &&\n \tgrep Master union &&\n \tgrep Side union\n@@ -104,14 +104,14 @@ test_expect_success 'custom merge backend' '\n \n \tgit merge master &&\n \n-\tcmp binary union &&\n+\ttest_cmp binary union &&\n \tsed -e 1,3d text >check-1 &&\n \to=$(git unpack-file master^:text) &&\n \ta=$(git unpack-file side^:text) &&\n \tb=$(git unpack-file master:text) &&\n \tsh -c \"./custom-merge $o $a $b 0\" &&\n \tsed -e 1,3d $a >check-2 &&\n-\tcmp check-1 check-2 &&\n+\ttest_cmp check-1 check-2 &&\n \trm -f $o $a $b\n '\n \n@@ -131,14 +131,14 @@ test_expect_success 'custom merge backend' '\n \t\techo \"Ok, conflicted\"\n \tfi &&\n \n-\tcmp binary union &&\n+\ttest_cmp binary union &&\n \tsed -e 1,3d text >check-1 &&\n \to=$(git unpack-file master^:text) &&\n \ta=$(git unpack-file anchor:text) &&\n \tb=$(git unpack-file master:text) &&\n \tsh -c \"./custom-merge $o $a $b 0\" &&\n \tsed -e 1,3d $a >check-2 &&\n-\tcmp check-1 check-2 &&\n+\ttest_cmp check-1 check-2 &&\n \trm -f $o $a $b\n '\n \n-- \n1.6.3.15.g49878\n"},{"id":"113574","messageId":"1242070141-2936-7-git-send-email-Don.Slutz@SierraAtlantic.com","threadId":"19301","inReplyTo":"1242070141-2936-6-git-send-email-Don.Slutz@SierraAtlantic.com","subject":"[PATCH 6/6] Add 'make test-text'","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-11T19:29:01Z","receivedAt":"2009-05-11T19:29:01Z","isPatch":true,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"Signed-off-by: Don Slutz <Don.Slutz@SierraAtlantic.com>\n---\n Makefile |   10 ++++++++++\n 1 files changed, 10 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 6e21643..03176a4 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1482,6 +1482,16 @@ export NO_SVN_TESTS\n test: all\n \t$(MAKE) -C t/ all\n \n+test-text: all\n+ifeq ($(uname_O),Cygwin)\n+\t@echo Test text mode mount\n+\tmount -f -u -t $(shell sh -c 'cygpath -m -a t') $(shell sh -c 'cygpath -u -a t')\n+\t$(MAKE) -C t/ all\n+\tumount -u $(shell sh -c 'cygpath -u -a t')\n+else\n+\tGIT_TEST_AUTO_CRLF=$${GIT_TEST_AUTO_CRLF:-true} $(MAKE) -C t/ all\n+endif\n+\n test-ctype$X: ctype.o\n \n test-date$X: date.o ctype.o\n-- \n1.6.3.15.g49878\n"},{"id":"113579","messageId":"loom.20090511T195910-370@post.gmane.org","threadId":"19301","inReplyTo":"1242070141-2936-1-git-send-email-Don.Slutz@SierraAtlantic.com","subject":"Re: [PATCH 0/6] Add core.autocrlf=true on cygwin by default during tests","fromName":"Eric Blake","fromEmail":"ebb9@byu.net","sentAt":"2009-05-11T20:04:25Z","receivedAt":"2009-05-11T20:04:25Z","isPatch":true,"sender":{"key":"eblake@redhat.com","avatar":"https://avatars.githubusercontent.com/u/32933908?v=4"},"body":"Don Slutz <Don.Slutz <at> SierraAtlantic.com> writes:\n\n> \n> This is a patch set to do the work from mail message:\n> \n> http://kerneltrap.org/mailarchive/git/2007/8/7/254415\n> \n> It is split into 6 parts.  This is because the tests do not work on\n> Linux if autocrlf=true.\n> \n> 1) The change to autocrlf=true by default for cygwin\n\nI help maintain the cygwin packaging of git, and I don't particularly like \npatch 1/6.  Cygwin very much recommends that users stick with binary mounts, \nwhere cr's are not inserted/stripped by default, and enabling autocrlf in that \nsituation is asking for problems (namely, the same set of problems as you would \nhave on Linux with autocrlf=true).  While adding an environment variable is \nuseful for the case of a user building git on cygwin with the intent of using a \ntext-mode mount, it goes against the grain of cygwin's recommendation of not \nusing text-mode mounts in the first place.  I would rather see the default \nremain false, even on cygwin, unless the person building git takes steps to \nactivate it themselves.\n\n-- \nEric Blake\n"},{"id":"113586","messageId":"alpine.DEB.1.00.0905112253580.27348@pacific.mpi-cbg.de","threadId":"19301","inReplyTo":"1242070141-2936-1-git-send-email-Don.Slutz@SierraAtlantic.com","subject":"Re: [PATCH 0/6] Add core.autocrlf=true on cygwin by default during tests","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-05-11T20:54:30Z","receivedAt":"2009-05-11T20:54:30Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 11 May 2009, Don Slutz wrote:\n\n> This is a patch set to do the work from mail message:\n> \n> http://kerneltrap.org/mailarchive/git/2007/8/7/254415\n> \n> It is split into 6 parts.  This is because the tests do not work on\n> Linux if autocrlf=true.\n> \n> 1) The change to autocrlf=true by default for cygwin\n\n>From the fallout of our unilateral decision in msysGit to set \nautoCRLF=true all the time, I would advise against this change.\n\nCiao,\nDscho\n"},{"id":"113598","messageId":"20090511222011.GA7609@hashpling.org","threadId":"19301","inReplyTo":"1242070141-2936-4-git-send-email-Don.Slutz@SierraAtlantic.com","subject":"Re: [PATCH 3/6] Fix tests to work with core.autocrlf=true","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2009-05-11T22:20:11Z","receivedAt":"2009-05-11T22:20:11Z","isPatch":true,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"On Mon, May 11, 2009 at 03:28:58PM -0400, Don Slutz wrote:\n> diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh\n> index e768c3e..bf39e45 100755\n> --- a/t/t7610-mergetool.sh\n> +++ b/t/t7610-mergetool.sh\n> @@ -45,9 +45,9 @@ test_expect_success 'custom mergetool' '\n>      ( yes \"\" | git mergetool file1 >/dev/null 2>&1 ) &&\n>      ( yes \"\" | git mergetool file2 >/dev/null 2>&1 ) &&\n>      ( yes \"\" | git mergetool subdir/file3 >/dev/null 2>&1 ) &&\n> -    test \"$(cat file1)\" = \"master updated\" &&\n> -    test \"$(cat file2)\" = \"master new\" &&\n> -    test \"$(cat subdir/file3)\" = \"master new sub\" &&\n> +    test_cat_eq file1 \"master updated\" &&\n> +    test_cat_eq file2 \"master new\" &&\n> +    test_cat_eq subdir/file3 \"master new sub\" &&\n>      git commit -m \"branch1 resolved with mergetool\"\n>  '\n\nThis change concerns me. At the moment, the mergetool test assumes\nthat globally autocrlf is true and has further tests that attempt to\nverify its behaviour with autocrlf set to true. See the very next\ntest:\n\ntest_expect_success 'mergetool crlf' '\n    git config core.autocrlf true &&\n    git checkout -b test2 branch1\n    test_must_fail git merge master >/dev/null 2>&1 &&\n    ( yes \"\" | git mergetool file1 >/dev/null 2>&1 ) &&\n    ( yes \"\" | git mergetool file2 >/dev/null 2>&1 ) &&\n    ( yes \"\" | git mergetool subdir/file3 >/dev/null 2>&1 ) &&\n    test \"$(printf x | cat file1 -)\" = \"$(printf \"master updated\\r\\nx\")\" &&\n    test \"$(printf x | cat file2 -)\" = \"$(printf \"master new\\r\\nx\")\" &&\n    test \"$(printf x | cat subdir/file3 -)\" = \"$(printf \"master new sub\\r\\nx\")\" &&\n    git commit -m \"branch1 resolved with mergetool - autocrlf\" &&\n    git config core.autocrlf false &&\n    git reset --hard\n'\n\nDoes the resetting of core.autocrlf to false not break the subsequent\ntests?\n\n-- \nCharles Bailey\nhttp://ccgi.hashpling.plus.com/blog/\n"},{"id":"113678","messageId":"4A09BCFC.4080307@SierraAtlantic.com","threadId":"19301","inReplyTo":"alpine.DEB.1.00.0905112253580.27348@pacific.mpi-cbg.de","subject":"Re: [PATCH 0/6] Add core.autocrlf=true on cygwin by default during tests","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-12T18:16:28Z","receivedAt":"2009-05-12T18:16:28Z","isPatch":true,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"Based on:\n\nOn 5/11/2009 4:54 PM, Johannes Schindelin wrote:\n> Hi,\n>\n> On Mon, 11 May 2009, Don Slutz wrote:\n>\n>   \n>> This is a patch set to do the work from mail message:\n>>\n>> http://kerneltrap.org/mailarchive/git/2007/8/7/254415\n>>\n>> It is split into 6 parts.  This is because the tests do not work on\n>> Linux if autocrlf=true.\n>>\n>> 1) The change to autocrlf=true by default for cygwin\n>>     \n>\n> From the fallout of our unilateral decision in msysGit to set \n> autoCRLF=true all the time, I would advise against this change.\n>\n> Ciao,\n> Dscho\n>   \n\nOn 5/11/2009 4:04 PM, Eric Blake wrote:\n> Don Slutz <Don.Slutz <at> SierraAtlantic.com> writes:\n>\n>   \n>> This is a patch set to do the work from mail message:\n>>\n>> http://kerneltrap.org/mailarchive/git/2007/8/7/254415\n>>\n>> It is split into 6 parts.  This is because the tests do not work on\n>> Linux if autocrlf=true.\n>>\n>> 1) The change to autocrlf=true by default for cygwin\n>>     \n>\n> I help maintain the cygwin packaging of git, and I don't particularly like \n> patch 1/6.  Cygwin very much recommends that users stick with binary mounts, \n> where cr's are not inserted/stripped by default, and enabling autocrlf in that \n> situation is asking for problems (namely, the same set of problems as you would \n> have on Linux with autocrlf=true).  While adding an environment variable is \n> useful for the case of a user building git on cygwin with the intent of using a \n> text-mode mount, it goes against the grain of cygwin's recommendation of not \n> using text-mode mounts in the first place.  I would rather see the default \n> remain false, even on cygwin, unless the person building git takes steps to \n> activate it themselves.\n>\n>   \nI will change 1/6 into adding the environment variable without the \ndefault change. v2 sometime soon.\n   -Don\n\n\n__________________________________________________________________________________________________________________\nDISCLAIMER:\"The information contained in this message and the attachments (if any) may be privileged and confidential and protected from disclosure. You are hereby notified that any unauthorized use, dissemination, distribution or copying of this communication, review, retransmission, or taking of any action based upon this information, by persons or entities other than the intended recipient, is strictly prohibited. If you are not the intended recipient or an employee or agent responsible for delivering this message, and have received this communication in error, please notify us immediately by replying to the message and kindly delete the original message, attachments, if any, and all its copies from your computer system. Thank you for your cooperation.\" \n________________________________________________________________________________________________________________\n"},{"id":"113709","messageId":"7viqk57vh8.fsf@alter.siamese.dyndns.org","threadId":"19301","inReplyTo":"loom.20090511T195910-370@post.gmane.org","subject":"Re: [PATCH 0/6] Add core.autocrlf=true on cygwin by default during tests","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-12T23:27:31Z","receivedAt":"2009-05-12T23:27:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Blake <ebb9@byu.net> writes:\n\n> Don Slutz <Don.Slutz <at> SierraAtlantic.com> writes:\n>\n>> \n>> This is a patch set to do the work from mail message:\n>> \n>> http://kerneltrap.org/mailarchive/git/2007/8/7/254415\n>> \n>> It is split into 6 parts.  This is because the tests do not work on\n>> Linux if autocrlf=true.\n>> \n>> 1) The change to autocrlf=true by default for cygwin\n>\n> I help maintain the cygwin packaging of git, and I don't particularly like \n> patch 1/6.  Cygwin very much recommends that users stick with binary mounts, \n> where cr's are not inserted/stripped by default, and enabling autocrlf in that \n> situation is asking for problems...\n\nOk, thanks for the comments; I won't touch this for now myself, with\nobjections and concerns from people working on windows (you on Cygwin\nside, and Dscho on msysgit side).\n"},{"id":"113814","messageId":"7vzldg6gui.fsf@alter.siamese.dyndns.org","threadId":"19301","inReplyTo":"7viqk57vh8.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 0/6] Add core.autocrlf=true on cygwin by default during tests","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-13T17:41:09Z","receivedAt":"2009-05-13T17:41:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Eric Blake <ebb9@byu.net> writes:\n> ...\n>> I help maintain the cygwin packaging of git, and I don't particularly like \n>> patch 1/6.  Cygwin very much recommends that users stick with binary mounts, \n>> where cr's are not inserted/stripped by default, and enabling autocrlf in that \n>> situation is asking for problems...\n>\n> Ok, thanks for the comments; I won't touch this for now myself, with\n> objections and concerns from people working on windows (you on Cygwin\n> side, and Dscho on msysgit side).\n\nJust to make sure I do not cause misunderstanding, I did not mean I won't\ntouch this ever; I obviously meant \"...until the concerns raised by windows\npeople are addressed to their satisfaction, as they are much better judge\nthan I am on this topic.\"\n"},{"id":"113836","messageId":"1242243348-6690-1-git-send-email-Don.Slutz@SierraAtlantic.com","threadId":"19301","inReplyTo":"1242070141-2936-1-git-send-email-Don.Slutz@SierraAtlantic.com","subject":"[PATCH v2 0/7] Add GIT_TEST_AUTO_CRLF environment variable to set core.autocrlf on init","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-13T19:35:41Z","receivedAt":"2009-05-13T19:35:41Z","isPatch":true,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"This is v2 of [PATCH 0/6] Add core.autocrlf=true on cygwin by default during tests\n\nChanges: \n\nChanged #1 to no longer default to true for CYGWIN.\n\nModified t7610-mergetool.sh in #3 to correctly change core.autocrlf mode\nand add test for the right thing in core.autocrlf=false\n\nNew patch #6 -- switch to using cmp instead of test_cmp for test that are\n                checking autocrlf does the right thing.\n"},{"id":"113830","messageId":"1242243348-6690-2-git-send-email-Don.Slutz@SierraAtlantic.com","threadId":"19301","inReplyTo":"1242243348-6690-1-git-send-email-Don.Slutz@SierraAtlantic.com","subject":"[PATCH v2 1/7] Add GIT_TEST_AUTO_CRLF environment variable to set core.autocrlf on init","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-13T19:35:42Z","receivedAt":"2009-05-13T19:35:42Z","isPatch":true,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"Normal usage:\n\nGIT_TEST_AUTO_CRLF=true make test\n\nSigned-off-by: Don Slutz <Don.Slutz@SierraAtlantic.com>\n---\n t/test-lib.sh |   12 +++++++++++-\n 1 files changed, 11 insertions(+), 1 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex dad1437..6178e8c 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -59,7 +59,12 @@ export GIT_MERGE_VERBOSITY\n export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME\n export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME\n export EDITOR VISUAL\n-GIT_TEST_CMP=${GIT_TEST_CMP:-diff -u}\n+\n+if test ! -z $GIT_TEST_AUTO_CRLF && test $GIT_TEST_AUTO_CRLF = true; then\n+\tGIT_TEST_CMP=${GIT_TEST_CMP:-diff -uw}\n+else\n+\tGIT_TEST_CMP=${GIT_TEST_CMP:-diff -u}\n+fi\n \n # Protect ourselves from common misconfiguration to export\n # CDPATH into the environment\n@@ -493,6 +498,11 @@ test_create_repo () {\n \tcd \"$repo\" || error \"Cannot setup test environment\"\n \t\"$GIT_EXEC_PATH/git-init\" \"--template=$TEST_DIRECTORY/../templates/blt/\" >&3 2>&4 ||\n \terror \"cannot run git init -- have you built things yet?\"\n+\ttest ! -z \"$GIT_TEST_AUTO_CRLF\" &&\n+\ttest_debug \"echo Switching to autocrlf=$GIT_TEST_AUTO_CRLF\" && {\n+\t\tgit config core.autocrlf $GIT_TEST_AUTO_CRLF ||\n+\t\terror \"Failed to switch to autocrlf=$GIT_TEST_AUTO_CRLF\"\n+\t}\n \tmv .git/hooks .git/hooks-disabled\n \tcd \"$owd\"\n }\n-- \n1.6.3.15.g49878\n"},{"id":"113831","messageId":"1242243348-6690-3-git-send-email-Don.Slutz@SierraAtlantic.com","threadId":"19301","inReplyTo":"1242243348-6690-2-git-send-email-Don.Slutz@SierraAtlantic.com","subject":"[PATCH v2 2/7] Add support functions for tests in core.autocrlf=true","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-13T19:35:43Z","receivedAt":"2009-05-13T19:35:43Z","isPatch":true,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"test_external_with_only_warning() -- Ignore CRLF warnings\ntest_eq_cat() -- like \"test foo = $(cat bar)\" but works in any setting of\n                 core.autocrlf\ntest_ne_cat() -- like \"test foo != $(cat bar)\"\ntest_cat_eq() -- like \"test $(cat foo) = bar\"\n\nSigned-off-by: Don Slutz <Don.Slutz@SierraAtlantic.com>\n---\n t/test-lib.sh |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 53 insertions(+), 0 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 6178e8c..2e0fd43 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -453,6 +453,35 @@ test_external_without_stderr () {\n \tfi\n }\n \n+# Like test_external, but in addition tests that the command generated\n+# only \"warning: LF will be replaced by CRLF\" output on stderr.\n+test_external_with_only_warning () {\n+\t# The temporary file has no (and must have no) security\n+\t# implications.\n+\ttmp=\"$TMPDIR\"; if [ -z \"$tmp\" ]; then tmp=/tmp; fi\n+\tstderr=\"$tmp/git-external-stderr.$$.tmp\"\n+\ttest_external \"$@\" 4> \"$stderr\"\n+\t[ -f \"$stderr\" ] || error \"Internal error: $stderr disappeared.\"\n+\tdescr=\"only warning: $1\"\n+\tshift\n+\tsay >&3 \"expecting only warnings from previous command\"\n+\toutput=$(grep -v \"warning: LF will be replaced by CRLF in\" $stderr)\n+\ttest_debug \"echo non-warning: $output\"\n+\tif [ -z \"$output\" ]; then\n+\t\trm \"$stderr\"\n+\t\ttest_ok_ \"$descr\"\n+\telse\n+\t\tif [ \"$verbose\" = t ]; then\n+\t\t\toutput=`echo; echo Stderr is:; cat \"$stderr\"`\n+\t\telse\n+\t\t\toutput=\n+\t\tfi\n+\t\t# rm first in case test_failure exits.\n+\t\trm \"$stderr\"\n+\t\ttest_failure_ \"$descr\" \"$@\" \"$output\"\n+\tfi\n+}\n+\n # This is not among top-level (test_expect_success | test_expect_failure)\n # but is a prefix that can be used in the test script, like:\n #\n@@ -487,6 +516,30 @@ test_cmp() {\n \t$GIT_TEST_CMP \"$@\"\n }\n \n+# test_eq_cat is a helper function to compare a 1 word file\n+# with a string.\n+# It almost the same as: test foo = $(cat bar)\n+# for: test_eq_cat foo bar\n+#\n+# However it works when core.autocrlf = true.\n+\n+test_eq_cat() {\n+\ttest \"$1\" = \"$(tr '\\015' '\\012' < \"$2\")\"\n+}\n+\n+# the but not-equal -- may not catch all cases\n+\n+test_ne_cat() {\n+\ttest \"$1\" != \"$(tr '\\015' '\\012' < \"$2\")\"\n+}\n+\n+# the same as test_eq_cat, but file is 1st.\n+\n+test_cat_eq() {\n+\ttest \"$(tr '\\015' '\\012' < \"$1\")\" = \"$2\"\n+}\n+\n+\n # Most tests can use the created repository, but some may need to create more.\n # Usage: test_create_repo <directory>\n test_create_repo () {\n-- \n1.6.3.15.g49878\n"},{"id":"113835","messageId":"1242243348-6690-4-git-send-email-Don.Slutz@SierraAtlantic.com","threadId":"19301","inReplyTo":"1242243348-6690-3-git-send-email-Don.Slutz@SierraAtlantic.com","subject":"[PATCH v2 3/7] Fix tests to work with core.autocrlf=true -- new functions","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-13T19:35:44Z","receivedAt":"2009-05-13T19:35:44Z","isPatch":true,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"Use the new functions to fix tests.\n\nSigned-off-by: Don Slutz <Don.Slutz@SierraAtlantic.com>\n---\n t/t0002-gitfile.sh                        |    3 +-\n t/t2004-checkout-cache-temp.sh            |   42 ++++++++++++++--------------\n t/t2008-checkout-subdir.sh                |   14 +++++-----\n t/t3404-rebase-interactive.sh             |    2 +-\n t/t3410-rebase-preserve-dropped-merges.sh |   12 ++++----\n t/t3413-rebase-hook.sh                    |   32 +++++++++++-----------\n t/t3503-cherry-pick-root.sh               |    2 +-\n t/t3903-stash.sh                          |   12 ++++----\n t/t4102-apply-rename.sh                   |    5 ++-\n t/t4124-apply-ws-rule.sh                  |   23 ++++++++++++---\n t/t4125-apply-ws-fuzz.sh                  |    9 +++++-\n t/t4128-apply-root.sh                     |    8 +++---\n t/t4150-am.sh                             |    4 +-\n t/t4252-am-options.sh                     |   16 ++++++++---\n t/t5000-tar-tree.sh                       |   12 +++++---\n t/t5001-archive-attr.sh                   |    3 ++\n t/t5520-pull.sh                           |   12 ++++----\n t/t7003-filter-branch.sh                  |    4 +-\n t/t7201-co.sh                             |    2 +-\n t/t7402-submodule-rebase.sh               |    4 +-\n t/t7610-mergetool.sh                      |   35 ++++++++++++++++++++----\n t/t7800-difftool.sh                       |   13 +++++----\n t/t9700-perl-git.sh                       |    2 +-\n 23 files changed, 165 insertions(+), 106 deletions(-)\n\ndiff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh\nindex cb14425..3762714 100755\n--- a/t/t0002-gitfile.sh\n+++ b/t/t0002-gitfile.sh\n@@ -60,7 +60,8 @@ test_expect_success 'final setup + check rev-parse --git-dir' '\n \n test_expect_success 'check hash-object' '\n \techo \"foo\" >bar &&\n-\tSHA=$(cat bar | git hash-object -w --stdin) &&\n+\tSHA=$(cat bar | git hash-object -w --stdin --path=bar) &&\n+\ttest_debug \"echo SHA=$SHA\" &&\n \tobjck $SHA\n '\n \ndiff --git a/t/t2004-checkout-cache-temp.sh b/t/t2004-checkout-cache-temp.sh\nindex 36cca14..ce4c584 100755\n--- a/t/t2004-checkout-cache-temp.sh\n+++ b/t/t2004-checkout-cache-temp.sh\n@@ -44,7 +44,7 @@ test $(wc -l <out) = 1 &&\n test $(cut \"-d\t\" -f2 out) = path1 &&\n p=$(cut \"-d\t\" -f1 out) &&\n test -f $p &&\n-test $(cat $p) = tree1path1'\n+test_cat_eq $p tree1path1'\n \n test_expect_success \\\n 'checkout all stage 0 to temporary files' '\n@@ -57,7 +57,7 @@ do\n \ttest $(grep $f out | cut \"-d\t\" -f2) = $f &&\n \tp=$(grep $f out | cut \"-d\t\" -f1) &&\n \ttest -f $p &&\n-\ttest $(cat $p) = tree1$f\n+\ttest_cat_eq $p tree1$f\n done'\n \n test_expect_success \\\n@@ -73,7 +73,7 @@ test $(wc -l <out) = 1 &&\n test $(cut \"-d\t\" -f2 out) = path1 &&\n p=$(cut \"-d\t\" -f1 out) &&\n test -f $p &&\n-test $(cat $p) = tree2path1'\n+test_cat_eq $p tree2path1'\n \n test_expect_success \\\n 'checkout all stage 2 to temporary files' '\n@@ -85,7 +85,7 @@ do\n \ttest $(grep $f out | cut \"-d\t\" -f2) = $f &&\n \tp=$(grep $f out | cut \"-d\t\" -f1) &&\n \ttest -f $p &&\n-\ttest $(cat $p) = tree2$f\n+\ttest_cat_eq $p tree2$f\n done'\n \n test_expect_success \\\n@@ -104,9 +104,9 @@ cut \"-d\t\" -f1 out | (read s1 s2 s3 &&\n test -f $s1 &&\n test -f $s2 &&\n test -f $s3 &&\n-test $(cat $s1) = tree1path1 &&\n-test $(cat $s2) = tree2path1 &&\n-test $(cat $s3) = tree3path1)'\n+test_cat_eq $s1 tree1path1 &&\n+test_cat_eq $s2 tree2path1 &&\n+test_cat_eq $s3 tree3path1)'\n \n test_expect_success \\\n 'checkout some stages/one file to temporary files' '\n@@ -118,8 +118,8 @@ cut \"-d\t\" -f1 out | (read s1 s2 s3 &&\n test $s1 = . &&\n test -f $s2 &&\n test -f $s3 &&\n-test $(cat $s2) = tree2path2 &&\n-test $(cat $s3) = tree3path2)'\n+test_cat_eq $s2 tree2path2 &&\n+test_cat_eq $s3 tree3path2)'\n \n test_expect_success \\\n 'checkout all stages/all files to temporary files' '\n@@ -138,9 +138,9 @@ grep path1 out | cut \"-d\t\" -f1 | (read s1 s2 s3 &&\n test -f $s1 &&\n test -f $s2 &&\n test -f $s3 &&\n-test $(cat $s1) = tree1path1 &&\n-test $(cat $s2) = tree2path1 &&\n-test $(cat $s3) = tree3path1)'\n+test_cat_eq $s1 tree1path1 &&\n+test_cat_eq $s2 tree2path1 &&\n+test_cat_eq $s3 tree3path1)'\n \n test_expect_success \\\n '-- path2: no stage 1, have stage 2 and 3' '\n@@ -149,8 +149,8 @@ grep path2 out | cut \"-d\t\" -f1 | (read s1 s2 s3 &&\n test $s1 = . &&\n test -f $s2 &&\n test -f $s3 &&\n-test $(cat $s2) = tree2path2 &&\n-test $(cat $s3) = tree3path2)'\n+test_cat_eq $s2 tree2path2 &&\n+test_cat_eq $s3 tree3path2)'\n \n test_expect_success \\\n '-- path3: no stage 2, have stage 1 and 3' '\n@@ -159,8 +159,8 @@ grep path3 out | cut \"-d\t\" -f1 | (read s1 s2 s3 &&\n test -f $s1 &&\n test $s2 = . &&\n test -f $s3 &&\n-test $(cat $s1) = tree1path3 &&\n-test $(cat $s3) = tree3path3)'\n+test_cat_eq $s1 tree1path3 &&\n+test_cat_eq $s3 tree3path3)'\n \n test_expect_success \\\n '-- path4: no stage 3, have stage 1 and 3' '\n@@ -169,8 +169,8 @@ grep path4 out | cut \"-d\t\" -f1 | (read s1 s2 s3 &&\n test -f $s1 &&\n test -f $s2 &&\n test $s3 = . &&\n-test $(cat $s1) = tree1path4 &&\n-test $(cat $s2) = tree2path4)'\n+test_cat_eq $s1 tree1path4 &&\n+test_cat_eq $s2 tree2path4)'\n \n test_expect_success \\\n '-- asubdir/path5: no stage 2 and 3 have stage 1' '\n@@ -179,7 +179,7 @@ grep asubdir/path5 out | cut \"-d\t\" -f1 | (read s1 s2 s3 &&\n test -f $s1 &&\n test $s2 = . &&\n test $s3 = . &&\n-test $(cat $s1) = tree1asubdir/path5)'\n+test_cat_eq $s1 tree1asubdir/path5)'\n \n test_expect_success \\\n 'checkout --temp within subdir' '\n@@ -191,7 +191,7 @@ test_expect_success \\\n  test -f ../$s1 &&\n  test $s2 = . &&\n  test $s3 = . &&\n- test $(cat ../$s1) = tree1asubdir/path5)\n+ test_cat_eq ../$s1 tree1asubdir/path5)\n )'\n \n test_expect_success SYMLINKS \\\n@@ -207,6 +207,6 @@ test $(wc -l <out) = 1 &&\n test $(cut \"-d\t\" -f2 out) = a &&\n p=$(cut \"-d\t\" -f1 out) &&\n test -f $p &&\n-test $(cat $p) = b'\n+test_cat_eq $p b'\n \n test_done\ndiff --git a/t/t2008-checkout-subdir.sh b/t/t2008-checkout-subdir.sh\nindex 3e098ab..7933197 100755\n--- a/t/t2008-checkout-subdir.sh\n+++ b/t/t2008-checkout-subdir.sh\n@@ -27,14 +27,14 @@ test_expect_success 'remove and restore with relative path' '\n \t\tcd dir1 &&\n \t\trm ../file0 &&\n \t\tgit checkout HEAD -- ../file0 &&\n-\t\ttest \"base\" = \"$(cat ../file0)\" &&\n+\t\ttest_eq_cat base ../file0 &&\n \t\trm ../dir2/file2 &&\n \t\tgit checkout HEAD -- ../dir2/file2 &&\n-\t\ttest \"bonjour\" = \"$(cat ../dir2/file2)\" &&\n+\t\ttest_eq_cat bonjour ../dir2/file2 &&\n \t\trm ../file0 ./file1 &&\n \t\tgit checkout HEAD -- .. &&\n-\t\ttest \"base\" = \"$(cat ../file0)\" &&\n-\t\ttest \"hello\" = \"$(cat file1)\"\n+\t\ttest_eq_cat base ../file0 &&\n+\t\ttest_eq_cat hello file1\n \t)\n \n '\n@@ -43,7 +43,7 @@ test_expect_success 'checkout with empty prefix' '\n \n \trm file0 &&\n \tgit checkout HEAD -- file0 &&\n-\ttest \"base\" = \"$(cat file0)\"\n+\ttest_eq_cat base file0\n \n '\n \n@@ -51,10 +51,10 @@ test_expect_success 'checkout with simple prefix' '\n \n \trm dir1/file1 &&\n \tgit checkout HEAD -- dir1 &&\n-\ttest \"hello\" = \"$(cat dir1/file1)\" &&\n+\ttest_eq_cat hello dir1/file1 &&\n \trm dir1/file1 &&\n \tgit checkout HEAD -- dir1/file1 &&\n-\ttest \"hello\" = \"$(cat dir1/file1)\"\n+\ttest_eq_cat hello dir1/file1\n \n '\n \ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex c32ff66..6990c77 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -162,7 +162,7 @@ test_expect_success 'squash' '\n \tGIT_AUTHOR_NAME=\"Nitfol\" git commit -m \"nitfol\" file7 &&\n \techo \"******************************\" &&\n \tFAKE_LINES=\"1 squash 2\" git rebase -i --onto master HEAD~2 &&\n-\ttest B = $(cat file7) &&\n+\ttest_eq_cat B file7 &&\n \ttest $(git rev-parse HEAD^) = $(git rev-parse master)\n '\n \ndiff --git a/t/t3410-rebase-preserve-dropped-merges.sh b/t/t3410-rebase-preserve-dropped-merges.sh\nindex c49143a..a044962 100755\n--- a/t/t3410-rebase-preserve-dropped-merges.sh\n+++ b/t/t3410-rebase-preserve-dropped-merges.sh\n@@ -52,9 +52,9 @@ test_expect_success 'skip same-resolution merges with -p' '\n \ttest_commit K file7 file7 &&\n \tgit rebase -i -p L &&\n \ttest $(git rev-parse HEAD^^) = $(git rev-parse L) &&\n-\ttest \"23\" = \"$(cat file1)\" &&\n-\ttest \"I\" = \"$(cat file6)\" &&\n-\ttest \"file7\" = \"$(cat file7)\"\n+\ttest_eq_cat 23 file1 &&\n+\ttest_eq_cat I file6 &&\n+\ttest_eq_cat file7 file7\n '\n \n # A - B - C - D - E\n@@ -77,9 +77,9 @@ test_expect_success 'keep different-resolution merges with -p' '\n \tgit add file1 &&\n \tgit rebase --continue &&\n \ttest $(git rev-parse HEAD^^^) = $(git rev-parse L2) &&\n-\ttest \"234\" = \"$(cat file1)\" &&\n-\ttest \"I\" = \"$(cat file6)\" &&\n-\ttest \"file7\" = \"$(cat file7)\"\n+\ttest_eq_cat 234 file1 &&\n+\ttest_eq_cat I file6 &&\n+\ttest_eq_cat file7 file7\n '\n \n test_done\ndiff --git a/t/t3413-rebase-hook.sh b/t/t3413-rebase-hook.sh\nindex 098b755..ac9ad05 100755\n--- a/t/t3413-rebase-hook.sh\n+++ b/t/t3413-rebase-hook.sh\n@@ -27,14 +27,14 @@ test_expect_success 'rebase' '\n \tgit checkout test &&\n \tgit reset --hard side &&\n \tgit rebase master &&\n-\ttest \"z$(cat git)\" = zworld\n+\ttest_cat_eq git world\n '\n \n test_expect_success 'rebase -i' '\n \tgit checkout test &&\n \tgit reset --hard side &&\n \tEDITOR=true git rebase -i master &&\n-\ttest \"z$(cat git)\" = zworld\n+\ttest_cat_eq git world\n '\n \n test_expect_success 'setup pre-rebase hook' '\n@@ -50,8 +50,8 @@ test_expect_success 'pre-rebase hook gets correct input (1)' '\n \tgit checkout test &&\n \tgit reset --hard side &&\n \tgit rebase master &&\n-\ttest \"z$(cat git)\" = zworld &&\n-\ttest \"z$(cat .git/PRE-REBASE-INPUT)\" = zmaster,\n+\ttest_cat_eq git world &&\n+\ttest_cat_eq .git/PRE-REBASE-INPUT master,\n \n '\n \n@@ -59,8 +59,8 @@ test_expect_success 'pre-rebase hook gets correct input (2)' '\n \tgit checkout test &&\n \tgit reset --hard side &&\n \tgit rebase master test &&\n-\ttest \"z$(cat git)\" = zworld &&\n-\ttest \"z$(cat .git/PRE-REBASE-INPUT)\" = zmaster,test\n+\ttest_cat_eq git world &&\n+\ttest_cat_eq .git/PRE-REBASE-INPUT master,test\n '\n \n test_expect_success 'pre-rebase hook gets correct input (3)' '\n@@ -68,16 +68,16 @@ test_expect_success 'pre-rebase hook gets correct input (3)' '\n \tgit reset --hard side &&\n \tgit checkout master &&\n \tgit rebase master test &&\n-\ttest \"z$(cat git)\" = zworld &&\n-\ttest \"z$(cat .git/PRE-REBASE-INPUT)\" = zmaster,test\n+\ttest_cat_eq git world &&\n+\ttest_cat_eq .git/PRE-REBASE-INPUT master,test\n '\n \n test_expect_success 'pre-rebase hook gets correct input (4)' '\n \tgit checkout test &&\n \tgit reset --hard side &&\n \tEDITOR=true git rebase -i master &&\n-\ttest \"z$(cat git)\" = zworld &&\n-\ttest \"z$(cat .git/PRE-REBASE-INPUT)\" = zmaster,\n+\ttest_cat_eq git world &&\n+\ttest_cat_eq .git/PRE-REBASE-INPUT master,\n \n '\n \n@@ -85,8 +85,8 @@ test_expect_success 'pre-rebase hook gets correct input (5)' '\n \tgit checkout test &&\n \tgit reset --hard side &&\n \tEDITOR=true git rebase -i master test &&\n-\ttest \"z$(cat git)\" = zworld &&\n-\ttest \"z$(cat .git/PRE-REBASE-INPUT)\" = zmaster,test\n+\ttest_cat_eq git world &&\n+\ttest_cat_eq .git/PRE-REBASE-INPUT master,test\n '\n \n test_expect_success 'pre-rebase hook gets correct input (6)' '\n@@ -94,8 +94,8 @@ test_expect_success 'pre-rebase hook gets correct input (6)' '\n \tgit reset --hard side &&\n \tgit checkout master &&\n \tEDITOR=true git rebase -i master test &&\n-\ttest \"z$(cat git)\" = zworld &&\n-\ttest \"z$(cat .git/PRE-REBASE-INPUT)\" = zmaster,test\n+\ttest_cat_eq git world &&\n+\ttest_cat_eq .git/PRE-REBASE-INPUT master,test\n '\n \n test_expect_success 'setup pre-rebase hook that fails' '\n@@ -132,7 +132,7 @@ test_expect_success 'rebase --no-verify overrides pre-rebase (1)' '\n \tgit reset --hard side &&\n \tgit rebase --no-verify master &&\n \ttest \"z$(git symbolic-ref HEAD)\" = zrefs/heads/test &&\n-\ttest \"z$(cat git)\" = zworld\n+\ttest_cat_eq git world\n '\n \n test_expect_success 'rebase --no-verify overrides pre-rebase (2)' '\n@@ -140,7 +140,7 @@ test_expect_success 'rebase --no-verify overrides pre-rebase (2)' '\n \tgit reset --hard side &&\n \tEDITOR=true git rebase --no-verify -i master &&\n \ttest \"z$(git symbolic-ref HEAD)\" = zrefs/heads/test &&\n-\ttest \"z$(cat git)\" = zworld\n+\ttest_cat_eq git world\n '\n \n test_done\ndiff --git a/t/t3503-cherry-pick-root.sh b/t/t3503-cherry-pick-root.sh\nindex b0faa29..dfcd72a 100755\n--- a/t/t3503-cherry-pick-root.sh\n+++ b/t/t3503-cherry-pick-root.sh\n@@ -23,7 +23,7 @@ test_expect_success setup '\n test_expect_success 'cherry-pick a root commit' '\n \n \tgit cherry-pick master &&\n-\ttest first = $(cat file1)\n+\ttest_eq_cat first file1\n \n '\n \ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex 7484cbe..7c1e169 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -49,7 +49,7 @@ test_expect_success 'apply stashed changes' '\n \ttest_tick &&\n \tgit commit -m other-file &&\n \tgit stash apply &&\n-\ttest 3 = $(cat file) &&\n+\ttest_eq_cat 3 file &&\n \ttest 1 = $(git show :file) &&\n \ttest 1 = $(git show HEAD:file)\n '\n@@ -61,7 +61,7 @@ test_expect_success 'apply stashed changes (including index)' '\n \ttest_tick &&\n \tgit commit -m other-file &&\n \tgit stash apply --index &&\n-\ttest 3 = $(cat file) &&\n+\ttest_eq_cat 3 file &&\n \ttest 2 = $(git show :file) &&\n \ttest 1 = $(git show HEAD:file)\n '\n@@ -83,7 +83,7 @@ test_expect_success 'drop top stash' '\n \tgit stash list > stashlist2 &&\n \tdiff stashlist1 stashlist2 &&\n \tgit stash apply &&\n-\ttest 3 = $(cat file) &&\n+\ttest_eq_cat 3 file &&\n \ttest 1 = $(git show :file) &&\n \ttest 1 = $(git show HEAD:file)\n '\n@@ -97,13 +97,13 @@ test_expect_success 'drop middle stash' '\n \tgit stash drop stash@{1} &&\n \ttest 2 = $(git stash list | wc -l) &&\n \tgit stash apply &&\n-\ttest 9 = $(cat file) &&\n+\ttest_eq_cat 9 file &&\n \ttest 1 = $(git show :file) &&\n \ttest 1 = $(git show HEAD:file) &&\n \tgit reset --hard &&\n \tgit stash drop &&\n \tgit stash apply &&\n-\ttest 3 = $(cat file) &&\n+\ttest_eq_cat 3 file &&\n \ttest 1 = $(git show :file) &&\n \ttest 1 = $(git show HEAD:file)\n '\n@@ -111,7 +111,7 @@ test_expect_success 'drop middle stash' '\n test_expect_success 'stash pop' '\n \tgit reset --hard &&\n \tgit stash pop &&\n-\ttest 3 = $(cat file) &&\n+\ttest_eq_cat 3 file &&\n \ttest 1 = $(git show :file) &&\n \ttest 1 = $(git show HEAD:file) &&\n \ttest 0 = $(git stash list | wc -l)\ndiff --git a/t/t4102-apply-rename.sh b/t/t4102-apply-rename.sh\nindex 1597965..5c7300d 100755\n--- a/t/t4102-apply-rename.sh\n+++ b/t/t4102-apply-rename.sh\n@@ -43,7 +43,7 @@ test_expect_success FILEMODE validate \\\n \n test_expect_success 'apply reverse' \\\n     'git apply -R --index --stat --summary --apply test-patch &&\n-     test \"$(cat foo)\" = \"This is foo\"'\n+     test_cat_eq foo \"This is foo\"'\n \n cat >test-patch <<\\EOF\n diff --git a/foo b/bar\n@@ -59,6 +59,7 @@ EOF\n \n test_expect_success 'apply copy' \\\n     'git apply --index --stat --summary --apply test-patch &&\n-     test \"$(cat bar)\" = \"This is bar\" -a \"$(cat foo)\" = \"This is foo\"'\n+     test_cat_eq bar \"This is bar\" &&\n+     test_cat_eq foo \"This is foo\"'\n \n test_done\ndiff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh\nindex f83322e..3933dd9 100755\n--- a/t/t4124-apply-ws-rule.sh\n+++ b/t/t4124-apply-ws-rule.sh\n@@ -38,13 +38,19 @@ apply_patch () {\n \tgit apply \"$@\"\n }\n \n+remove_cr () {\n+\ttr '\\015' Q <\"$1\" | sed -e 's/Q$//'\n+}\n+\n test_fix () {\n \n \t# fix should not barf\n \tapply_patch --whitespace=fix || return 1\n \n+\ttest_debug \"echo patch applied: [$1]\"\n \t# find touched lines\n-\tdiff file target | sed -n -e \"s/^> //p\" >fixed\n+\tremove_cr target >target1\n+\tdiff file target1 | sed -n -e \"s/^> //p\" >fixed\n \n \t# the changed lines are all expeced to change\n \tfixed_cnt=$(wc -l <fixed)\n@@ -52,6 +58,7 @@ test_fix () {\n \t'') expect_cnt=$fixed_cnt ;;\n \t?*) expect_cnt=$(grep \"[$1]\" <fixed | wc -l) ;;\n \tesac\n+\ttest_debug \"echo fixed: $fixed_cnt vs $expect_cnt\"\n \ttest $fixed_cnt -eq $expect_cnt || return 1\n \n \t# and we are not missing anything\n@@ -59,12 +66,14 @@ test_fix () {\n \t'') expect_cnt=0 ;;\n \t?*) expect_cnt=$(grep \"[$1]\" <file | wc -l) ;;\n \tesac\n+\ttest_debug \"echo missing: $fixed_cnt vs $expect_cnt\"\n \ttest $fixed_cnt -eq $expect_cnt || return 1\n \n \t# Get the patch actually applied\n \tgit diff-files -p target >fixed-patch\n \ttest -s fixed-patch && return 0\n \n+\ttest_debug \"echo failed to apply, try and fix\"\n \t# Make sure it is complaint-free\n \t>target\n \tgit apply --whitespace=error-all <fixed-patch\n@@ -85,14 +94,16 @@ test_expect_success setup '\n test_expect_success 'whitespace=nowarn, default rule' '\n \n \tapply_patch --whitespace=nowarn &&\n-\tdiff file target\n+\tremove_cr target >target1 &&\n+\tdiff file target1\n \n '\n \n test_expect_success 'whitespace=warn, default rule' '\n \n \tapply_patch --whitespace=warn &&\n-\tdiff file target\n+\tremove_cr target >target1 &&\n+\tdiff file target1\n \n '\n \n@@ -108,7 +119,8 @@ test_expect_success 'whitespace=error-all, no rule' '\n \n \tgit config core.whitespace -trailing,-space-before,-indent &&\n \tapply_patch --whitespace=error-all &&\n-\tdiff file target\n+\tremove_cr target >target1 &&\n+\tdiff file target1\n \n '\n \n@@ -117,7 +129,8 @@ test_expect_success 'whitespace=error-all, no rule (attribute)' '\n \tgit config --unset core.whitespace &&\n \techo \"target -whitespace\" >.gitattributes &&\n \tapply_patch --whitespace=error-all &&\n-\tdiff file target\n+\tremove_cr target >target1 &&\n+\tdiff file target1\n \n '\n \ndiff --git a/t/t4125-apply-ws-fuzz.sh b/t/t4125-apply-ws-fuzz.sh\nindex 3b471b6..c02fe08 100755\n--- a/t/t4125-apply-ws-fuzz.sh\n+++ b/t/t4125-apply-ws-fuzz.sh\n@@ -4,6 +4,10 @@ test_description='applying patch that has broken whitespaces in context'\n \n . ./test-lib.sh\n \n+remove_cr () {\n+\ttr '\\015' Q <\"$1\" | sed -e 's/Q$//'\n+}\n+\n test_expect_success setup '\n \n \t>file &&\n@@ -91,12 +95,13 @@ test_expect_success 'withfix (backward)' '\n \n \tsed -e /h/d file-fixed >fixed-head &&\n \tsed -e /h/d file >file-head &&\n-\ttest_cmp fixed-head file-head &&\n+\tremove_cr file-head >file-head1\n+\tdiff fixed-head file-head1 &&\n \n \tsed -n -e /h/p file-fixed >fixed-tail &&\n \tsed -n -e /h/p file >file-tail &&\n \n-\t! test_cmp fixed-tail file-tail\n+\t! diff fixed-tail file-tail\n \n '\n \ndiff --git a/t/t4128-apply-root.sh b/t/t4128-apply-root.sh\nindex 8f6aea4..a03a9c8 100755\n--- a/t/t4128-apply-root.sh\n+++ b/t/t4128-apply-root.sh\n@@ -27,7 +27,7 @@ test_expect_success 'apply --directory -p (1)' '\n \n \tgit apply --directory=some/sub -p3 --index patch &&\n \ttest Bello = $(git show :some/sub/dir/file) &&\n-\ttest Bello = $(cat some/sub/dir/file)\n+\ttest_eq_cat Bello some/sub/dir/file\n \n '\n \n@@ -36,7 +36,7 @@ test_expect_success 'apply --directory -p (2) ' '\n \tgit reset --hard initial &&\n \tgit apply --directory=some/sub/ -p3 --index patch &&\n \ttest Bello = $(git show :some/sub/dir/file) &&\n-\ttest Bello = $(cat some/sub/dir/file)\n+\ttest_eq_cat Bello some/sub/dir/file\n \n '\n \n@@ -54,7 +54,7 @@ test_expect_success 'apply --directory (new file)' '\n \tgit reset --hard initial &&\n \tgit apply --directory=some/sub/dir/ --index patch &&\n \ttest content = $(git show :some/sub/dir/newfile) &&\n-\ttest content = $(cat some/sub/dir/newfile)\n+\ttest_eq_cat content some/sub/dir/newfile\n '\n \n cat > patch << EOF\n@@ -89,7 +89,7 @@ test_expect_success 'apply --directory (quoted filename)' '\n \tgit reset --hard initial &&\n \tgit apply --directory=some/sub/dir/ --index patch &&\n \ttest content = $(git show :some/sub/dir/quotefile) &&\n-\ttest content = $(cat some/sub/dir/quotefile)\n+\ttest_eq_cat content some/sub/dir/quotefile\n '\n \n test_done\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex d6ebbae..27570b7 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -190,7 +190,7 @@ test_expect_success 'am --skip works' '\n \tgit am --skip &&\n \t! test -d .git/rebase-apply &&\n \ttest -z \"$(git diff lorem2^^ -- file)\" &&\n-\ttest goodbye = \"$(cat another)\"\n+\ttest_eq_cat goodbye another\n '\n \n test_expect_success 'am --resolved works' '\n@@ -201,7 +201,7 @@ test_expect_success 'am --resolved works' '\n \tgit add file &&\n \tgit am --resolved &&\n \t! test -d .git/rebase-apply &&\n-\ttest goodbye = \"$(cat another)\"\n+\ttest_eq_cat goodbye another\n '\n \n test_expect_success 'am takes patches from a Pine mailbox' '\ndiff --git a/t/t4252-am-options.sh b/t/t4252-am-options.sh\nindex f603c1b..342fc1a 100755\n--- a/t/t4252-am-options.sh\n+++ b/t/t4252-am-options.sh\n@@ -3,6 +3,10 @@\n test_description='git am with options and not losing them'\n . ./test-lib.sh\n \n+remove_cr () {\n+\ttr '\\015' Q <\"$1\" | sed -e 's/Q$//'\n+}\n+\n tm=\"$TEST_DIRECTORY/t4252\"\n \n test_expect_success setup '\n@@ -20,7 +24,8 @@ test_expect_success 'interrupted am --whitespace=fix' '\n \ttest_must_fail git am --whitespace=fix \"$tm\"/am-test-1-? &&\n \tgit am --skip &&\n \tgrep 3 file-1 &&\n-\tgrep \"^Six$\" file-2\n+\tremove_cr file-2 >file-2a &&\n+\tgrep \"^Six$\" file-2a\n '\n \n test_expect_success 'interrupted am -C1' '\n@@ -29,7 +34,8 @@ test_expect_success 'interrupted am -C1' '\n \ttest_must_fail git am -C1 \"$tm\"/am-test-2-? &&\n \tgit am --skip &&\n \tgrep 3 file-1 &&\n-\tgrep \"^Three$\" file-2\n+\tremove_cr file-2 >file-2a &&\n+\tgrep \"^Three$\" file-2a\n '\n \n test_expect_success 'interrupted am -p2' '\n@@ -38,7 +44,8 @@ test_expect_success 'interrupted am -p2' '\n \ttest_must_fail git am -p2 \"$tm\"/am-test-3-? &&\n \tgit am --skip &&\n \tgrep 3 file-1 &&\n-\tgrep \"^Three$\" file-2\n+\tremove_cr file-2 >file-2a &&\n+\tgrep \"^Three$\" file-2a\n '\n \n test_expect_success 'interrupted am -C1 -p2' '\n@@ -47,7 +54,8 @@ test_expect_success 'interrupted am -C1 -p2' '\n \ttest_must_fail git am -p2 -C1 \"$tm\"/am-test-4-? &&\n \tgit am --skip &&\n \tgrep 3 file-1 &&\n-\tgrep \"^Three$\" file-2\n+\tremove_cr file-2 >file-2a &&\n+\tgrep \"^Three$\" file-2a\n '\n \n test_expect_success 'interrupted am --directory=\"frotz nitfol\"' '\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex abb41b0..28d6291 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -25,6 +25,8 @@ commit id embedding:\n '\n \n . ./test-lib.sh\n+autocrlf=$(git config core.autocrlf)\n+\n UNZIP=${UNZIP:-unzip}\n \n SUBSTFORMAT=%H%n\n@@ -66,6 +68,8 @@ test_expect_success \\\n     'git clone --bare . bare.git &&\n      cp .git/info/attributes bare.git/info/attributes'\n \n+test ! -z \"$autocrlf\" && (cd bare.git; git config core.autocrlf $autocrlf)\n+\n test_expect_success \\\n     'remove ignored file' \\\n     'rm a/ignored'\n@@ -118,7 +122,7 @@ test_expect_success \\\n \n test_expect_success \\\n     'validate file contents' \\\n-    'diff -r a b/a'\n+    'diff -rb a b/a'\n \n test_expect_success \\\n     'git tar-tree with prefix' \\\n@@ -135,7 +139,7 @@ test_expect_success \\\n \n test_expect_success \\\n     'validate file contents with prefix' \\\n-    'diff -r a c/prefix/a'\n+    'diff -rb a c/prefix/a'\n \n test_expect_success \\\n     'create archives with substfiles' \\\n@@ -203,7 +207,7 @@ test_expect_success UNZIP \\\n \n test_expect_success UNZIP \\\n     'validate file contents' \\\n-    'diff -r a d/a'\n+    'diff -rb a d/a'\n \n test_expect_success \\\n     'git archive --format=zip with prefix' \\\n@@ -220,7 +224,7 @@ test_expect_success UNZIP \\\n \n test_expect_success UNZIP \\\n     'validate file contents with prefix' \\\n-    'diff -r a e/prefix/a'\n+    'diff -rb a e/prefix/a'\n \n test_expect_success \\\n     'git archive --list outside of a git repo' \\\ndiff --git a/t/t5001-archive-attr.sh b/t/t5001-archive-attr.sh\nindex 426b319..2efa018 100755\n--- a/t/t5001-archive-attr.sh\n+++ b/t/t5001-archive-attr.sh\n@@ -3,6 +3,7 @@\n test_description='git archive attribute tests'\n \n . ./test-lib.sh\n+autocrlf=$(git config core.autocrlf)\n \n SUBSTFORMAT=%H%n\n \n@@ -39,6 +40,8 @@ test_expect_success 'setup' '\n \tcp .git/info/attributes bare/info/attributes\n '\n \n+test ! -z \"$autocrlf\" && (cd bare; git config core.autocrlf $autocrlf)\n+\n test_expect_success 'git archive' '\n \tgit archive HEAD >archive.tar &&\n \t(mkdir archive && cd archive && \"$TAR\" xf -) <archive.tar\ndiff --git a/t/t5520-pull.sh b/t/t5520-pull.sh\nindex 725771f..4d4e7ac 100755\n--- a/t/t5520-pull.sh\n+++ b/t/t5520-pull.sh\n@@ -49,9 +49,9 @@ test_expect_success 'test . as a remote' '\n \techo updated >file &&\n \tgit commit -a -m updated &&\n \tgit checkout copy &&\n-\ttest `cat file` = file &&\n+\ttest_cat_eq file file &&\n \tgit pull &&\n-\ttest `cat file` = updated\n+\ttest_cat_eq file updated\n '\n \n test_expect_success 'the default remote . should not break explicit pull' '\n@@ -60,9 +60,9 @@ test_expect_success 'the default remote . should not break explicit pull' '\n \tgit commit -a -m modified &&\n \tgit checkout copy &&\n \tgit reset --hard HEAD^ &&\n-\ttest `cat file` = file &&\n+\ttest_cat_eq file file &&\n \tgit pull . second &&\n-\ttest `cat file` = modified\n+\ttest_cat_eq file modified\n '\n \n test_expect_success '--rebase' '\n@@ -99,8 +99,8 @@ test_expect_success '--rebase with rebased upstream' '\n \techo file > file2 &&\n \tgit commit -m to-rebase file2 &&\n \tgit pull --rebase me copy &&\n-\ttest \"conflicting modification\" = \"$(cat file)\" &&\n-\ttest file = $(cat file2)\n+\ttest_eq_cat \"conflicting modification\" file &&\n+\ttest_eq_cat file file2\n \n '\n \ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex 329c851..c6e9fb5 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -72,7 +72,7 @@ test_expect_success 'test that the file was renamed' '\n \ttest d = \"$(git show HEAD:doh --)\" &&\n \t! test -f d &&\n \ttest -f doh &&\n-\ttest d = \"$(cat doh)\"\n+\ttest_eq_cat d doh\n '\n \n test_expect_success 'rewrite, renaming a specific directory' '\n@@ -85,7 +85,7 @@ test_expect_success 'test that the directory was renamed' '\n \ttest -d diroh &&\n \t! test -d diroh/dir &&\n \ttest -f diroh/d &&\n-\ttest dir/d = \"$(cat diroh/d)\"\n+\ttest_eq_cat dir/d diroh/d\n '\n \n git tag oldD HEAD~4\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex bdb808a..62f58eb 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -434,7 +434,7 @@ test_expect_success 'checkout unmerged stage' '\n \ttest_cmp expect filf &&\n \ttest_cmp expect file &&\n \tgit checkout --theirs file &&\n-\ttest ztheirside = \"z$(cat file)\"\n+\ttest_eq_cat theirside file\n '\n \n test_expect_success 'checkout with --merge' '\ndiff --git a/t/t7402-submodule-rebase.sh b/t/t7402-submodule-rebase.sh\nindex f919c8d..8e5d747 100755\n--- a/t/t7402-submodule-rebase.sh\n+++ b/t/t7402-submodule-rebase.sh\n@@ -80,11 +80,11 @@ test_expect_success 'stash with a dirty submodule' '\n \techo new > file &&\n \tCURRENT=$(cd submodule && git rev-parse HEAD) &&\n \tgit stash &&\n-\ttest new != $(cat file) &&\n+\ttest_ne_cat new file &&\n \ttest submodule = $(git diff --name-only) &&\n \ttest $CURRENT = $(cd submodule && git rev-parse HEAD) &&\n \tgit stash apply &&\n-\ttest new = $(cat file) &&\n+\ttest_eq_cat new file &&\n \ttest $CURRENT = $(cd submodule && git rev-parse HEAD)\n \n '\ndiff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh\nindex e768c3e..a3794a3 100755\n--- a/t/t7610-mergetool.sh\n+++ b/t/t7610-mergetool.sh\n@@ -8,6 +8,8 @@ test_description='git mergetool\n Testing basic merge tool invocation'\n \n . ./test-lib.sh\n+autocrlf=$(git config core.autocrlf)\n+test -z \"$autocrlf\" && autocrlf=false\n \n # All the mergetool test work by checking out a temporary branch based\n # off 'branch1' and then merging in master and checking the results of\n@@ -45,15 +47,17 @@ test_expect_success 'custom mergetool' '\n     ( yes \"\" | git mergetool file1 >/dev/null 2>&1 ) &&\n     ( yes \"\" | git mergetool file2 >/dev/null 2>&1 ) &&\n     ( yes \"\" | git mergetool subdir/file3 >/dev/null 2>&1 ) &&\n-    test \"$(cat file1)\" = \"master updated\" &&\n-    test \"$(cat file2)\" = \"master new\" &&\n-    test \"$(cat subdir/file3)\" = \"master new sub\" &&\n+    test_cat_eq file1 \"master updated\" &&\n+    test_cat_eq file2 \"master new\" &&\n+    test_cat_eq subdir/file3 \"master new sub\" &&\n     git commit -m \"branch1 resolved with mergetool\"\n '\n \n test_expect_success 'mergetool crlf' '\n     git config core.autocrlf true &&\n-    git checkout -b test2 branch1\n+    rm -f .git/index &&\n+    git reset --hard &&\n+    git checkout -b test2 branch1 &&\n     test_must_fail git merge master >/dev/null 2>&1 &&\n     ( yes \"\" | git mergetool file1 >/dev/null 2>&1 ) &&\n     ( yes \"\" | git mergetool file2 >/dev/null 2>&1 ) &&\n@@ -62,16 +66,35 @@ test_expect_success 'mergetool crlf' '\n     test \"$(printf x | cat file2 -)\" = \"$(printf \"master new\\r\\nx\")\" &&\n     test \"$(printf x | cat subdir/file3 -)\" = \"$(printf \"master new sub\\r\\nx\")\" &&\n     git commit -m \"branch1 resolved with mergetool - autocrlf\" &&\n+    git config core.autocrlf $autocrlf &&\n+    rm -f .git/index &&\n+    git reset --hard\n+'\n+\n+test_expect_success 'mergetool lf' '\n     git config core.autocrlf false &&\n+    rm -f .git/index &&\n+    git reset --hard &&\n+    git checkout -b test3 branch1 &&\n+    test_must_fail git merge master >/dev/null 2>&1 &&\n+    ( yes \"\" | git mergetool file1 >/dev/null 2>&1 ) &&\n+    ( yes \"\" | git mergetool file2 >/dev/null 2>&1 ) &&\n+    ( yes \"\" | git mergetool subdir/file3 >/dev/null 2>&1 ) &&\n+    test \"$(printf x | cat file1 -)\" = \"$(printf \"master updated\\nx\")\" &&\n+    test \"$(printf x | cat file2 -)\" = \"$(printf \"master new\\nx\")\" &&\n+    test \"$(printf x | cat subdir/file3 -)\" = \"$(printf \"master new sub\\nx\")\" &&\n+    git commit -m \"branch1 resolved with mergetool - autocrlf2\" &&\n+    git config core.autocrlf $autocrlf &&\n+    rm -f .git/index &&\n     git reset --hard\n '\n \n test_expect_success 'mergetool in subdir' '\n-    git checkout -b test3 branch1\n+    git checkout -b test4 branch1 &&\n     cd subdir && (\n     test_must_fail git merge master >/dev/null 2>&1 &&\n     ( yes \"\" | git mergetool file3 >/dev/null 2>&1 ) &&\n-    test \"$(cat file3)\" = \"master new sub\" )\n+    test_cat_eq file3 \"master new sub\" )\n '\n \n # We can't merge files from parent directories when running mergetool\ndiff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh\nindex ebdccf9..b95069a 100755\n--- a/t/t7800-difftool.sh\n+++ b/t/t7800-difftool.sh\n@@ -35,11 +35,12 @@ restore_test_defaults()\n \tunset GIT_DIFFTOOL_PROMPT\n \tunset GIT_DIFFTOOL_NO_PROMPT\n \tgit config diff.tool test-tool &&\n-\tgit config difftool.test-tool.cmd 'cat $LOCAL'\n+\tgit config difftool.test-tool.cmd \"tr '\\015' '\\012' <\\$LOCAL\"\n }\n \n prompt_given()\n {\n+\ttest_debug \"echo prompt_given:$1\"\n \tprompt=\"$1\"\n \ttest \"$prompt\" = \"Hit return to launch 'test-tool': branch\"\n }\n@@ -59,7 +60,7 @@ test_expect_success 'setup' '\n # Configure a custom difftool.<tool>.cmd and use it\n test_expect_success 'custom commands' '\n \trestore_test_defaults &&\n-\tgit config difftool.test-tool.cmd \"cat \\$REMOTE\" &&\n+\tgit config difftool.test-tool.cmd \"tr '\\''\\015'\\'' '\\''\\012'\\'' <\\$REMOTE\" &&\n \n \tdiff=$(git difftool --no-prompt branch) &&\n \ttest \"$diff\" = \"master\" &&\n@@ -136,7 +137,7 @@ test_expect_success 'GIT_DIFFTOOL_PROMPT variable' '\n \tGIT_DIFFTOOL_PROMPT=true &&\n \texport GIT_DIFFTOOL_PROMPT &&\n \n-\tprompt=$(echo | git difftool --prompt branch | tail -1) &&\n+\tprompt=$(echo | git difftool --prompt branch | head -3 | tail -1) &&\n \tprompt_given \"$prompt\" &&\n \n \trestore_test_defaults\n@@ -166,7 +167,7 @@ test_expect_success 'difftool.prompt can overridden with -y' '\n test_expect_success 'difftool.prompt can overridden with --prompt' '\n \tgit config difftool.prompt false &&\n \n-\tprompt=$(echo | git difftool --prompt branch | tail -1) &&\n+\tprompt=$(echo | git difftool --prompt branch | head -3 | tail -1) &&\n \tprompt_given \"$prompt\" &&\n \n \trestore_test_defaults\n@@ -179,7 +180,7 @@ test_expect_success 'difftool last flag wins' '\n \n \trestore_test_defaults &&\n \n-\tprompt=$(echo | git difftool --no-prompt --prompt branch | tail -1) &&\n+\tprompt=$(echo | git difftool --no-prompt --prompt branch | head -3 | tail -1) &&\n \tprompt_given \"$prompt\" &&\n \n \trestore_test_defaults\n@@ -190,7 +191,7 @@ test_expect_success 'difftool last flag wins' '\n test_expect_success 'difftool + mergetool config variables' '\n \tremove_config_vars\n \tgit config merge.tool test-tool &&\n-\tgit config mergetool.test-tool.cmd \"cat \\$LOCAL\" &&\n+\tgit config mergetool.test-tool.cmd \"tr '\\''\\015'\\'' '\\''\\012'\\'' <\\$LOCAL\" &&\n \n \tdiff=$(git difftool --no-prompt branch) &&\n \ttest \"$diff\" = \"branch\" &&\ndiff --git a/t/t9700-perl-git.sh b/t/t9700-perl-git.sh\nindex b4ca244..76f741f 100755\n--- a/t/t9700-perl-git.sh\n+++ b/t/t9700-perl-git.sh\n@@ -42,7 +42,7 @@ test_expect_success \\\n      git config --add test.int 2k\n      '\n \n-test_external_without_stderr \\\n+test_external_with_only_warning \\\n     'Perl API' \\\n     perl \"$TEST_DIRECTORY\"/t9700/test.pl\n \n-- \n1.6.3.15.g49878\n"},{"id":"113837","messageId":"1242243348-6690-5-git-send-email-Don.Slutz@SierraAtlantic.com","threadId":"19301","inReplyTo":"1242243348-6690-4-git-send-email-Don.Slutz@SierraAtlantic.com","subject":"[PATCH v2 4/7] Fix tests to work with core.autocrlf=true -- force false","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-13T19:35:45Z","receivedAt":"2009-05-13T19:35:45Z","isPatch":true,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"Force core.autocrlf=false for these tests.  Most of these tests are checking\nfor whitespace differences and so are not simple to fix.  The rest are not\nclear how to fix.\n\nSigned-off-by: Don Slutz <Don.Slutz@SierraAtlantic.com>\n---\n t/t1002-read-tree-m-u-2way.sh |    3 ++-\n t/t4015-diff-whitespace.sh    |    2 ++\n t/t4019-diff-wserror.sh       |    1 +\n t/t4116-apply-reverse.sh      |    1 +\n t/t4200-rerere.sh             |    2 ++\n 5 files changed, 8 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh\nindex 5e40cec..acc9474 100755\n--- a/t/t1002-read-tree-m-u-2way.sh\n+++ b/t/t1002-read-tree-m-u-2way.sh\n@@ -37,7 +37,8 @@ check_cache_at () {\n \n test_expect_success \\\n     setup \\\n-    'echo frotz >frotz &&\n+    'git config core.autocrlf false &&\n+     echo frotz >frotz &&\n      echo nitfol >nitfol &&\n      echo bozbar >bozbar &&\n      echo rezrov >rezrov &&\ndiff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh\nindex 6d13da3..122557e 100755\n--- a/t/t4015-diff-whitespace.sh\n+++ b/t/t4015-diff-whitespace.sh\n@@ -9,6 +9,8 @@ test_description='Test special whitespace in diff engine.\n . ./test-lib.sh\n . \"$TEST_DIRECTORY\"/diff-lib.sh\n \n+test_expect_success \"setup\" 'git config core.autocrlf false'\n+\n # Ray Lehtiniemi's example\n \n cat << EOF > x\ndiff --git a/t/t4019-diff-wserror.sh b/t/t4019-diff-wserror.sh\nindex 84a1fe3..a580403 100755\n--- a/t/t4019-diff-wserror.sh\n+++ b/t/t4019-diff-wserror.sh\n@@ -6,6 +6,7 @@ test_description='diff whitespace error detection'\n \n test_expect_success setup '\n \n+\tgit config core.autocrlf false &&\n \tgit config diff.color.whitespace \"blue reverse\" &&\n \t>F &&\n \tgit add F &&\ndiff --git a/t/t4116-apply-reverse.sh b/t/t4116-apply-reverse.sh\nindex 2298ece..a846be6 100755\n--- a/t/t4116-apply-reverse.sh\n+++ b/t/t4116-apply-reverse.sh\n@@ -11,6 +11,7 @@ test_description='git apply in reverse\n \n test_expect_success setup '\n \n+\tgit config core.autocrlf false &&\n \tfor i in a b c d e f g h i j k l m n; do echo $i; done >file1 &&\n \tperl -pe \"y/ijk/\\\\000\\\\001\\\\002/\" <file1 >file2 &&\n \ndiff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh\nindex a6bc028..5e6cc82 100755\n--- a/t/t4200-rerere.sh\n+++ b/t/t4200-rerere.sh\n@@ -8,6 +8,8 @@ test_description='git rerere\n \n . ./test-lib.sh\n \n+git config core.autocrlf false\n+\n cat > a1 << EOF\n Some title\n ==========\n-- \n1.6.3.15.g49878\n"},{"id":"113833","messageId":"1242243348-6690-6-git-send-email-Don.Slutz@SierraAtlantic.com","threadId":"19301","inReplyTo":"1242243348-6690-5-git-send-email-Don.Slutz@SierraAtlantic.com","subject":"[PATCH v2 5/7] Fix tests to work with core.autocrlf=true -- cmp to test_cmp","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-13T19:35:46Z","receivedAt":"2009-05-13T19:35:46Z","isPatch":true,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"Switch from using cmp to using test_cmp in these tests.\n\nSigned-off-by: Don Slutz <Don.Slutz@SierraAtlantic.com>\n---\n t/t0021-conversion.sh        |   12 ++++++------\n t/t1020-subdirectory.sh      |   12 ++++++------\n t/t4127-apply-same-fn.sh     |    2 +-\n t/t6021-merge-criss-cross.sh |    2 +-\n t/t6026-merge-attr.sh        |   10 +++++-----\n 5 files changed, 19 insertions(+), 19 deletions(-)\n\ndiff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh\nindex 8fc39d7..7a6d8c7 100755\n--- a/t/t0021-conversion.sh\n+++ b/t/t0021-conversion.sh\n@@ -33,17 +33,17 @@ test_expect_success setup '\n \tgit checkout -- test test.t test.i\n '\n \n-script='s/^\\$Id: \\([0-9a-f]*\\) \\$/\\1/p'\n-\n test_expect_success check '\n \n-\tcmp test.o test &&\n-\tcmp test.o test.t &&\n+\ttest_cmp test.o test &&\n+\ttest_cmp test.o test.t &&\n \n \t# ident should be stripped in the repository\n \tgit diff --raw --exit-code :test :test.i &&\n \tid=$(git rev-parse --verify :test) &&\n-\tembedded=$(sed -ne \"$script\" test.i) &&\n+\ttest_debug \"echo id=$id\"\n+\tembedded=$(grep Id: test.i | cut -d\\  -f2) &&\n+\ttest_debug \"echo embedded=$embedded\"\n \ttest \"z$id\" = \"z$embedded\" &&\n \n \tgit cat-file blob :test.t > test.r &&\n@@ -85,7 +85,7 @@ test_expect_success expanded_in_repo '\n \trm -f expanded-keywords &&\n \tgit checkout -- expanded-keywords &&\n \tcat expanded-keywords &&\n-\tcmp expanded-keywords expected-output\n+\ttest_cmp expanded-keywords expected-output\n '\n \n test_done\ndiff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh\nindex 210e594..ce67e6c 100755\n--- a/t/t1020-subdirectory.sh\n+++ b/t/t1020-subdirectory.sh\n@@ -86,10 +86,10 @@ test_expect_success 'write-tree' '\n test_expect_success 'checkout-index' '\n \tcd \"$HERE\" &&\n \tgit checkout-index -f -u one &&\n-\tcmp one original.one &&\n+\ttest_cmp one original.one &&\n \tcd dir &&\n \tgit checkout-index -f -u two &&\n-\tcmp two ../original.two\n+\ttest_cmp two ../original.two\n '\n \n test_expect_success 'read-tree' '\n@@ -97,13 +97,13 @@ test_expect_success 'read-tree' '\n \trm -f one dir/two &&\n \ttree=`git write-tree` &&\n \tgit read-tree --reset -u \"$tree\" &&\n-\tcmp one original.one &&\n-\tcmp dir/two original.two &&\n+\ttest_cmp one original.one &&\n+\ttest_cmp dir/two original.two &&\n \tcd dir &&\n \trm -f two &&\n \tgit read-tree --reset -u \"$tree\" &&\n-\tcmp two ../original.two &&\n-\tcmp ../one ../original.one\n+\ttest_cmp two ../original.two &&\n+\ttest_cmp ../one ../original.one\n '\n \n test_expect_success 'no file/rev ambiguity check inside .git' '\ndiff --git a/t/t4127-apply-same-fn.sh b/t/t4127-apply-same-fn.sh\nindex 3a8202e..66b774f 100755\n--- a/t/t4127-apply-same-fn.sh\n+++ b/t/t4127-apply-same-fn.sh\n@@ -27,7 +27,7 @@ test_expect_success 'apply same filename with independent changes' '\n \tcp same_fn same_fn2 &&\n \tgit reset --hard &&\n \tgit apply patch0 &&\n-\tdiff same_fn same_fn2\n+\ttest_cmp same_fn same_fn2\n '\n \n test_expect_success 'apply same filename with overlapping changes' '\ndiff --git a/t/t6021-merge-criss-cross.sh b/t/t6021-merge-criss-cross.sh\nindex 331b9b0..53fdfd8 100755\n--- a/t/t6021-merge-criss-cross.sh\n+++ b/t/t6021-merge-criss-cross.sh\n@@ -87,7 +87,7 @@ cat > file-expect <<EOF\n 9\n EOF\n \n-test_expect_success 'Criss-cross merge result' 'cmp file file-expect'\n+test_expect_success 'Criss-cross merge result' 'test_cmp file file-expect'\n \n test_expect_success 'Criss-cross merge fails (-s resolve)' \\\n 'git reset --hard A^ &&\ndiff --git a/t/t6026-merge-attr.sh b/t/t6026-merge-attr.sh\nindex 1ba0a25..0b57c68 100755\n--- a/t/t6026-merge-attr.sh\n+++ b/t/t6026-merge-attr.sh\n@@ -63,7 +63,7 @@ test_expect_success 'check merge result in working tree' '\n \n \tgit cat-file -p HEAD:binary >binary-orig &&\n \tgrep \"<<<<<<<\" text &&\n-\tcmp binary-orig binary &&\n+\ttest_cmp binary-orig binary &&\n \t! grep \"<<<<<<<\" union &&\n \tgrep Master union &&\n \tgrep Side union\n@@ -104,14 +104,14 @@ test_expect_success 'custom merge backend' '\n \n \tgit merge master &&\n \n-\tcmp binary union &&\n+\ttest_cmp binary union &&\n \tsed -e 1,3d text >check-1 &&\n \to=$(git unpack-file master^:text) &&\n \ta=$(git unpack-file side^:text) &&\n \tb=$(git unpack-file master:text) &&\n \tsh -c \"./custom-merge $o $a $b 0\" &&\n \tsed -e 1,3d $a >check-2 &&\n-\tcmp check-1 check-2 &&\n+\ttest_cmp check-1 check-2 &&\n \trm -f $o $a $b\n '\n \n@@ -131,14 +131,14 @@ test_expect_success 'custom merge backend' '\n \t\techo \"Ok, conflicted\"\n \tfi &&\n \n-\tcmp binary union &&\n+\ttest_cmp binary union &&\n \tsed -e 1,3d text >check-1 &&\n \to=$(git unpack-file master^:text) &&\n \ta=$(git unpack-file anchor:text) &&\n \tb=$(git unpack-file master:text) &&\n \tsh -c \"./custom-merge $o $a $b 0\" &&\n \tsed -e 1,3d $a >check-2 &&\n-\tcmp check-1 check-2 &&\n+\ttest_cmp check-1 check-2 &&\n \trm -f $o $a $b\n '\n \n-- \n1.6.3.15.g49878\n"},{"id":"113832","messageId":"1242243348-6690-7-git-send-email-Don.Slutz@SierraAtlantic.com","threadId":"19301","inReplyTo":"1242243348-6690-6-git-send-email-Don.Slutz@SierraAtlantic.com","subject":"[PATCH v2 6/7] Fix tests to work with core.autocrlf=true -- test_cmp to cmp","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-13T19:35:47Z","receivedAt":"2009-05-13T19:35:47Z","isPatch":true,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"Switch from using test_cmp to using cmp in these tests. They are\nchecking for correct CRLF handling.\n\nSigned-off-by: Don Slutz <Don.Slutz@SierraAtlantic.com>\n---\n t/t0024-crlf-archive.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t0024-crlf-archive.sh b/t/t0024-crlf-archive.sh\nindex c7d0324..af084e5 100755\n--- a/t/t0024-crlf-archive.sh\n+++ b/t/t0024-crlf-archive.sh\n@@ -22,7 +22,7 @@ test_expect_success 'tar archive' '\n \tgit archive --format=tar HEAD |\n \t( mkdir untarred && cd untarred && \"$TAR\" -xf - )\n \n-\ttest_cmp sample untarred/sample\n+\tcmp sample untarred/sample\n \n '\n \n@@ -39,7 +39,7 @@ test_expect_success UNZIP 'zip archive' '\n \n \t( mkdir unzipped && cd unzipped && unzip ../test.zip ) &&\n \n-\ttest_cmp sample unzipped/sample\n+\tcmp sample unzipped/sample\n \n '\n \n-- \n1.6.3.15.g49878\n"},{"id":"113834","messageId":"1242243348-6690-8-git-send-email-Don.Slutz@SierraAtlantic.com","threadId":"19301","inReplyTo":"1242243348-6690-7-git-send-email-Don.Slutz@SierraAtlantic.com","subject":"[PATCH v2 7/7] Add 'make test-text' core.autocrlf=true","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-13T19:35:48Z","receivedAt":"2009-05-13T19:35:48Z","isPatch":true,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"This will test with core.autocrlf=true by default and\ntest using a text mount in CYGWIN\n\nSigned-off-by: Don Slutz <Don.Slutz@SierraAtlantic.com>\n---\n Makefile |   11 +++++++++++\n 1 files changed, 11 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 6e21643..2d85972 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1482,6 +1482,17 @@ export NO_SVN_TESTS\n test: all\n \t$(MAKE) -C t/ all\n \n+test-text: all\n+\t@echo Test core.autocrlf=true\n+ifeq ($(uname_O),Cygwin)\n+\t@echo Test text mode mount\n+\tmount -f -u -t $(shell sh -c 'cygpath -m -a t') $(shell sh -c 'cygpath -u -a t')\n+\tGIT_TEST_AUTO_CRLF=$${GIT_TEST_AUTO_CRLF:-true} $(MAKE) -C t/ all\n+\tumount -u $(shell sh -c 'cygpath -u -a t')\n+else\n+\tGIT_TEST_AUTO_CRLF=$${GIT_TEST_AUTO_CRLF:-true} $(MAKE) -C t/ all\n+endif\n+\n test-ctype$X: ctype.o\n \n test-date$X: date.o ctype.o\n-- \n1.6.3.15.g49878\n"},{"id":"113902","messageId":"20090514074303.GA8713@hashpling.org","threadId":"19301","inReplyTo":"1242243348-6690-4-git-send-email-Don.Slutz@SierraAtlantic.com","subject":"Re: [PATCH v2 3/7] Fix tests to work with core.autocrlf=true -- new functions","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2009-05-14T07:43:03Z","receivedAt":"2009-05-14T07:43:03Z","isPatch":true,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"On Wed, May 13, 2009 at 03:35:44PM -0400, Don Slutz wrote:\n>  test_expect_success 'mergetool crlf' '\n>      git config core.autocrlf true &&\n> -    git checkout -b test2 branch1\n> +    rm -f .git/index &&\n> +    git reset --hard &&\n> +    git checkout -b test2 branch1 &&\n>      test_must_fail git merge master >/dev/null 2>&1 &&\n>      ( yes \"\" | git mergetool file1 >/dev/null 2>&1 ) &&\n>      ( yes \"\" | git mergetool file2 >/dev/null 2>&1 ) &&\n> @@ -62,16 +66,35 @@ test_expect_success 'mergetool crlf' '\n>      test \"$(printf x | cat file2 -)\" = \"$(printf \"master new\\r\\nx\")\" &&\n>      test \"$(printf x | cat subdir/file3 -)\" = \"$(printf \"master new sub\\r\\nx\")\" &&\n>      git commit -m \"branch1 resolved with mergetool - autocrlf\" &&\n> +    git config core.autocrlf $autocrlf &&\n> +    rm -f .git/index &&\n> +    git reset --hard\n> +'\n> +\n> +test_expect_success 'mergetool lf' '\n>      git config core.autocrlf false &&\n> +    rm -f .git/index &&\n> +    git reset --hard &&\n> +    git checkout -b test3 branch1 &&\n> +    test_must_fail git merge master >/dev/null 2>&1 &&\n> +    ( yes \"\" | git mergetool file1 >/dev/null 2>&1 ) &&\n> +    ( yes \"\" | git mergetool file2 >/dev/null 2>&1 ) &&\n> +    ( yes \"\" | git mergetool subdir/file3 >/dev/null 2>&1 ) &&\n> +    test \"$(printf x | cat file1 -)\" = \"$(printf \"master updated\\nx\")\" &&\n> +    test \"$(printf x | cat file2 -)\" = \"$(printf \"master new\\nx\")\" &&\n> +    test \"$(printf x | cat subdir/file3 -)\" = \"$(printf \"master new sub\\nx\")\" &&\n> +    git commit -m \"branch1 resolved with mergetool - autocrlf2\" &&\n> +    git config core.autocrlf $autocrlf &&\n> +    rm -f .git/index &&\n>      git reset --hard\n>  '\n\nHave I missed some previous recent discussion about this patch series?\nI know that you referenced that long Aug 2007 thread about autocrlf,\nbut is there some more recent discussion about how the test suite\nworks / should work?\n\nmergetool isn't the prime implementor of autocrlf, but it does have\nsome checks to make sure that it works with autocrlf. My impression -\nprobably incorrect - has been that autocrlf is off for the purposes of\nbuilding and testing git on all platforms, but that some packages\nswitch it on by default on install for user convenience on platforms\nwhere this is appropriate.\n\nYour patch seems to be about allowing the entire test suite to run\ncorrectly with the autocrlf in any setting. If this is the case,\nshouldn't the correct fix be to remove tests that are testing that\nthings work with different settings of autocrlf, because these tests\nare effectively run by a full test suite run with autocrlf\nalternatively set anyway?\n\n-- \nCharles Bailey\nhttp://ccgi.hashpling.plus.com/blog/\n"},{"id":"113930","messageId":"4A0C2180.6030000@SierraAtlantic.com","threadId":"19301","inReplyTo":"20090511222011.GA7609@hashpling.org","subject":"Re: [PATCH 3/6] Fix tests to work with core.autocrlf=true","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-14T13:49:52Z","receivedAt":"2009-05-14T13:49:52Z","isPatch":true,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"On 5/11/2009 6:20 PM, Charles Bailey wrote:\n> On Mon, May 11, 2009 at 03:28:58PM -0400, Don Slutz wrote:\n>   \n>> diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh\n>> index e768c3e..bf39e45 100755\n>> --- a/t/t7610-mergetool.sh\n>> +++ b/t/t7610-mergetool.sh\n>> @@ -45,9 +45,9 @@ test_expect_success 'custom mergetool' '\n>>      ( yes \"\" | git mergetool file1 >/dev/null 2>&1 ) &&\n>>      ( yes \"\" | git mergetool file2 >/dev/null 2>&1 ) &&\n>>      ( yes \"\" | git mergetool subdir/file3 >/dev/null 2>&1 ) &&\n>> -    test \"$(cat file1)\" = \"master updated\" &&\n>> -    test \"$(cat file2)\" = \"master new\" &&\n>> -    test \"$(cat subdir/file3)\" = \"master new sub\" &&\n>> +    test_cat_eq file1 \"master updated\" &&\n>> +    test_cat_eq file2 \"master new\" &&\n>> +    test_cat_eq subdir/file3 \"master new sub\" &&\n>>      git commit -m \"branch1 resolved with mergetool\"\n>>  '\n>>     \n>\n> This change concerns me. At the moment, the mergetool test assumes\n> that globally autocrlf is true and has further tests that attempt to\n> verify its behaviour with autocrlf set to true.\nAssuming that should have been false and then true for the setting of \nautocrlf.  I would say that\nthis code does not fully check for autocrlf=false.  For version 1 of the \npatch I did not look for\nother tests that dis not include crlf in their name that had tests for \nchanging autocrlf.\n>  See the very next\n> test:\n>\n> test_expect_success 'mergetool crlf' '\n>     git config core.autocrlf true &&\n>     git checkout -b test2 branch1\n>     test_must_fail git merge master >/dev/null 2>&1 &&\n>     ( yes \"\" | git mergetool file1 >/dev/null 2>&1 ) &&\n>     ( yes \"\" | git mergetool file2 >/dev/null 2>&1 ) &&\n>     ( yes \"\" | git mergetool subdir/file3 >/dev/null 2>&1 ) &&\n>     test \"$(printf x | cat file1 -)\" = \"$(printf \"master updated\\r\\nx\")\" &&\n>     test \"$(printf x | cat file2 -)\" = \"$(printf \"master new\\r\\nx\")\" &&\n>     test \"$(printf x | cat subdir/file3 -)\" = \"$(printf \"master new sub\\r\\nx\")\" &&\n>     git commit -m \"branch1 resolved with mergetool - autocrlf\" &&\n>     git config core.autocrlf false &&\n>     git reset --hard\n> '\n>\n> Does the resetting of core.autocrlf to false not break the subsequent\n> tests?\n>\n>   \nIt does cause the subsequent tests to not be tested in autocrlf=true.  \nHowever I have verified that the sequence:\n\ngit config core.autocrlf false && git reset --hard\n\nDoes not do what you might expect.  A \"touch file1\" can cause \"git diff\" \nto start reporting a difference!\n\nPatch set v2 out soon.\n   -Don\n\n\n\n__________________________________________________________________________________________________________________\nDISCLAIMER:\"The information contained in this message and the attachments (if any) may be privileged and confidential and protected from disclosure. You are hereby notified that any unauthorized use, dissemination, distribution or copying of this communication, review, retransmission, or taking of any action based upon this information, by persons or entities other than the intended recipient, is strictly prohibited. If you are not the intended recipient or an employee or agent responsible for delivering this message, and have received this communication in error, please notify us immediately by replying to the message and kindly delete the original message, attachments, if any, and all its copies from your computer system. Thank you for your cooperation.\" \n________________________________________________________________________________________________________________\n"},{"id":"113933","messageId":"4A0C2D2D.9080707@SierraAtlantic.com","threadId":"19301","inReplyTo":"20090514074303.GA8713@hashpling.org","subject":"Re: [PATCH v2 3/7] Fix tests to work with core.autocrlf=true -- new functions","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-14T14:39:41Z","receivedAt":"2009-05-14T14:39:41Z","isPatch":true,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"On 5/14/2009 3:43 AM, Charles Bailey wrote,\n\n> On Wed, May 13, 2009 at 03:35:44PM -0400, Don Slutz wrote:\n>   \n>> Have I missed some previous recent discussion about this patch series?\n>> I know that you referenced that long Aug 2007 thread about autocrlf,\n>> but is there some more recent discussion about how the test suite\n>> works / should work?\n>>\n>>     \nNot that I have seen.  I did forget to send the previous reply, should \nnow be there.\n>> mergetool isn't the prime implementor of autocrlf, but it does have\n>> some checks to make sure that it works with autocrlf. My impression -\n>> probably incorrect - has been that autocrlf is off for the purposes of\n>> building and testing git on all platforms, but that some packages\n>> switch it on by default on install for user convenience on platforms\n>> where this is appropriate.\n>>\n>> Your patch seems to be about allowing the entire test suite to run\n>> correctly with the autocrlf in any setting. If this is the case,\n>> shouldn't the correct fix be to remove tests that are testing that\n>> things work with different settings of autocrlf, because these tests\n>> are effectively run by a full test suite run with autocrlf\n>> alternatively set anyway?\n>>\n>>     \nWell my take is that most of the tests do not care about autocrlf, they \nare checking that the right file or error is happening.  For example:\n\n\n   git commit -m \"c1\"\n  echo foo >file2\n  git checkout -- file2\n\njust wants to know that file2 is correctly reverted to before the \nchange.  The fact that file2 can have LF -> CRLF if autocrlf=true is not \nwhat is being checked for here.  There are several tests like \nt0020-crlf.sh that are checking that the right thing happens.\n\nI am assuming that t7610-mergetool.sh add the test for autocrlf=true \nbecause of some issue (bug?) that was fixed.  However I have not done a \nfull look into way the test is there.  I was focused on getting the \ntests to pass.\n\nAlso I do expect that most people will run the tests in the default mode \nonly.  I have no plans on add the \"run the tests in all possible \nsettings of autocrlf\".\n\nThis set seems like a subset (but still big) change on the path of \ngetting git to work and pass the tests under CYGWIN on a text mount.  \nThat change is still in progress and not yet ready for the list.\n\n   -Don\n\n\n__________________________________________________________________________________________________________________\nDISCLAIMER:\"The information contained in this message and the attachments (if any) may be privileged and confidential and protected from disclosure. You are hereby notified that any unauthorized use, dissemination, distribution or copying of this communication, review, retransmission, or taking of any action based upon this information, by persons or entities other than the intended recipient, is strictly prohibited. If you are not the intended recipient or an employee or agent responsible for delivering this message, and have received this communication in error, please notify us immediately by replying to the message and kindly delete the original message, attachments, if any, and all its copies from your computer system. Thank you for your cooperation.\" \n________________________________________________________________________________________________________________\n"}]}