git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 3/7] Fix tests to work with core.autocrlf=true -- new functions

From
Charles Bailey <charles@hashpling.org>
Date
May 14, 2009, 07:43 UTC
Message-ID
<20090514074303.GA8713@hashpling.org>
In-Reply-To
<1242243348-6690-4-git-send-email-Don.Slutz@SierraAtlantic.com>
On Wed, May 13, 2009 at 03:35:44PM -0400, Don Slutz wrote:
Show 35 quoted lines
>  test_expect_success 'mergetool crlf' '
>      git config core.autocrlf true &&
> -    git checkout -b test2 branch1
> +    rm -f .git/index &&
> +    git reset --hard &&
> +    git checkout -b test2 branch1 &&
>      test_must_fail git merge master >/dev/null 2>&1 &&
>      ( yes "" | git mergetool file1 >/dev/null 2>&1 ) &&
>      ( yes "" | git mergetool file2 >/dev/null 2>&1 ) &&
> @@ -62,16 +66,35 @@ test_expect_success 'mergetool crlf' '
>      test "$(printf x | cat file2 -)" = "$(printf "master new\r\nx")" &&
>      test "$(printf x | cat subdir/file3 -)" = "$(printf "master new sub\r\nx")" &&
>      git commit -m "branch1 resolved with mergetool - autocrlf" &&
> +    git config core.autocrlf $autocrlf &&
> +    rm -f .git/index &&
> +    git reset --hard
> +'
> +
> +test_expect_success 'mergetool lf' '
>      git config core.autocrlf false &&
> +    rm -f .git/index &&
> +    git reset --hard &&
> +    git checkout -b test3 branch1 &&
> +    test_must_fail git merge master >/dev/null 2>&1 &&
> +    ( yes "" | git mergetool file1 >/dev/null 2>&1 ) &&
> +    ( yes "" | git mergetool file2 >/dev/null 2>&1 ) &&
> +    ( yes "" | git mergetool subdir/file3 >/dev/null 2>&1 ) &&
> +    test "$(printf x | cat file1 -)" = "$(printf "master updated\nx")" &&
> +    test "$(printf x | cat file2 -)" = "$(printf "master new\nx")" &&
> +    test "$(printf x | cat subdir/file3 -)" = "$(printf "master new sub\nx")" &&
> +    git commit -m "branch1 resolved with mergetool - autocrlf2" &&
> +    git config core.autocrlf $autocrlf &&
> +    rm -f .git/index &&
>      git reset --hard
>  '

Have I missed some previous recent discussion about this patch series? I know that you referenced that long Aug 2007 thread about autocrlf, but is there some more recent discussion about how the test suite works / should work?

mergetool isn't the prime implementor of autocrlf, but it does have some checks to make sure that it works with autocrlf. My impression - probably incorrect - has been that autocrlf is off for the purposes of building and testing git on all platforms, but that some packages switch it on by default on install for user convenience on platforms where this is appropriate.

Your patch seems to be about allowing the entire test suite to run correctly with the autocrlf in any setting. If this is the case, shouldn't the correct fix be to remove tests that are testing that things work with different settings of autocrlf, because these tests are effectively run by a full test suite run with autocrlf alternatively set anyway?

-- 
Charles Bailey
http://ccgi.hashpling.plus.com/blog/
Previous: Don SlutzNext: Don Slutz
Message 23 of 24 in “Add core.autocrlf=true on cygwin by default during tests”
  1. 0/6 Add core.autocrlf=true on cygwin by default during testsDon Slutz, May 11, 2009
  2. 1/6 Add core.autocrlf=true on cygwin by default during testsDon Slutz, May 11, 2009
  3. 2/6 Fix tests to work with core.autocrlf=trueDon Slutz, May 11, 2009
  4. 3/6 Fix tests to work with core.autocrlf=trueDon Slutz, May 11, 2009
  5. 4/6 Fix tests to work with core.autocrlf=trueDon Slutz, May 11, 2009
  6. 5/6 Fix tests to work with core.autocrlf=trueDon Slutz, May 11, 2009
  7. 6/6 Add 'make test-text'Don Slutz, May 11, 2009
  8. Charles BaileyMay 11, 2009
  9. Don SlutzMay 14, 2009
  10. Eric BlakeMay 11, 2009
  11. Junio C HamanoMay 12, 2009
  12. Junio C HamanoMay 13, 2009
  13. Johannes SchindelinMay 11, 2009
  14. Don SlutzMay 12, 2009
  15. 0/7 Add GIT_TEST_AUTO_CRLF environment variable to set core.autocrlf on initDon Slutz, May 13, 2009
  16. 1/7 Add GIT_TEST_AUTO_CRLF environment variable to set core.autocrlf on initDon Slutz, May 13, 2009
  17. 2/7 Add support functions for tests in core.autocrlf=trueDon Slutz, May 13, 2009
  18. 3/7 Fix tests to work with core.autocrlf=true -- new functionsDon Slutz, May 13, 2009
  19. 4/7 Fix tests to work with core.autocrlf=true -- force falseDon Slutz, May 13, 2009
  20. 5/7 Fix tests to work with core.autocrlf=true -- cmp to test_cmpDon Slutz, May 13, 2009
  21. 6/7 Fix tests to work with core.autocrlf=true -- test_cmp to cmpDon Slutz, May 13, 2009
  22. 7/7 Add 'make test-text' core.autocrlf=trueDon Slutz, May 13, 2009
  23. Charles BaileyMay 14, 2009
  24. Don SlutzMay 14, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.