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

Re: [PATCH 17/19] mingw: fix git-svn tests that expect chmod to work

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 25, 2016, 02:14 UTC
Message-ID
<xmqq1t96be2k.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<9045a31ec16da672a74d9b1e0b65807d21ef277e.1453650173.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 6 quoted lines
> From: 마누엘 <nalla@users.noreply.github.com>
>
> Some git-svn tests expect that the executable bit of files can be
> toggled. On Windows, this is not possible because Windows' Access
> Control Lists are much more fine-grained than the POSIX permission
> concept. Let's just not try to flip the executable bit.

Most of the changes are protected by !POSIXPERM but one of them seems to use MINGW, which looks inconsistent and I suspect was not a distinction made on purpose. The above description sounds to me that the !POSIXPERM prerequisite is the right thing to use.

I am not sure if it is a good idea to sprinkle test-have-prereq and make the test script test different things on different platforms, though.

Show 110 quoted lines
> This lets t9118-git-svn-funky-branch-names.sh and
> t9124-git-svn-dcommit-auto-props.sh pass in Git for Windows' SDK,
> and partially fixes t9100-git-svn-basic.sh.
>
> Signed-off-by: 마누엘 <nalla@users.noreply.github.com>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>  t/t9100-git-svn-basic.sh              |  5 ++++-
>  t/t9118-git-svn-funky-branch-names.sh | 12 +++++++++---
>  t/t9124-git-svn-dcommit-auto-props.sh | 20 ++++++++++++++++----
>  3 files changed, 29 insertions(+), 8 deletions(-)
>
> diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh
> index dbb440b..bca7ec8 100755
> --- a/t/t9100-git-svn-basic.sh
> +++ b/t/t9100-git-svn-basic.sh
> @@ -38,7 +38,10 @@ test_expect_success \
>  		mkdir bar &&
>  		echo "zzz" >bar/zzz &&
>  		echo "#!/bin/sh" >exec.sh &&
> -		chmod +x exec.sh &&
> +		{
> +			test_have_prereq !POSIXPERM ||
> +			chmod +x exec.sh
> +		} &&
>  		svn_cmd import -m "import for git svn" . "$svnrepo" >/dev/null
>  	) &&
>  	rm -rf import &&
> diff --git a/t/t9118-git-svn-funky-branch-names.sh b/t/t9118-git-svn-funky-branch-names.sh
> index a221915..49775a5 100755
> --- a/t/t9118-git-svn-funky-branch-names.sh
> +++ b/t/t9118-git-svn-funky-branch-names.sh
> @@ -23,8 +23,11 @@ test_expect_success 'setup svnrepo' '
>  	              "$svnrepo/pr ject/branches/$scary_uri" &&
>  	svn_cmd cp -m "leading dot" "$svnrepo/pr ject/trunk" \
>  			"$svnrepo/pr ject/branches/.leading_dot" &&
> -	svn_cmd cp -m "trailing dot" "$svnrepo/pr ject/trunk" \
> -			"$svnrepo/pr ject/branches/trailing_dot." &&
> +	{
> +		test_have_prereq MINGW ||
> +		svn_cmd cp -m "trailing dot" "$svnrepo/pr ject/trunk" \
> +			"$svnrepo/pr ject/branches/trailing_dot."
> +	} &&
>  	svn_cmd cp -m "trailing .lock" "$svnrepo/pr ject/trunk" \
>  			"$svnrepo/pr ject/branches/trailing_dotlock.lock" &&
>  	svn_cmd cp -m "reflog" "$svnrepo/pr ject/trunk" \
> @@ -45,7 +48,10 @@ test_expect_success 'test clone with funky branch names' '
>  		git rev-parse "refs/remotes/origin/more%20fun%20plugin!" &&
>  		git rev-parse "refs/remotes/origin/$scary_ref" &&
>  		git rev-parse "refs/remotes/origin/%2Eleading_dot" &&
> -		git rev-parse "refs/remotes/origin/trailing_dot%2E" &&
> +		{
> +			test_have_prereq MINGW ||
> +			git rev-parse "refs/remotes/origin/trailing_dot%2E"
> +		} &&
>  		git rev-parse "refs/remotes/origin/trailing_dotlock%2Elock" &&
>  		git rev-parse "refs/remotes/origin/$non_reflog"
>  	)
> diff --git a/t/t9124-git-svn-dcommit-auto-props.sh b/t/t9124-git-svn-dcommit-auto-props.sh
> index aa841e1..c851121 100755
> --- a/t/t9124-git-svn-dcommit-auto-props.sh
> +++ b/t/t9124-git-svn-dcommit-auto-props.sh
> @@ -35,7 +35,10 @@ test_expect_success 'enable auto-props config' '
>  
>  test_expect_success 'add files matcihng auto-props' '
>  	echo "#!$SHELL_PATH" >exec1.sh &&
> -	chmod +x exec1.sh &&
> +	{
> +		test_have_prereq !POSIXPERM ||
> +		chmod +x exec1.sh
> +	} &&
>  	echo "hello" >hello.txt &&
>  	echo bar >bar &&
>  	git add exec1.sh hello.txt bar &&
> @@ -49,7 +52,10 @@ test_expect_success 'disable auto-props config' '
>  
>  test_expect_success 'add files matching disabled auto-props' '
>  	echo "#$SHELL_PATH" >exec2.sh &&
> -	chmod +x exec2.sh &&
> +	{
> +		test_have_prereq !POSIXPERM ||
> +		chmod +x exec2.sh
> +	} &&
>  	echo "world" >world.txt &&
>  	echo zot >zot &&
>  	git add exec2.sh world.txt zot &&
> @@ -65,7 +71,10 @@ test_expect_success 'check resulting svn repository' '
>  	cd svnrepo &&
>  
>  	# Check properties from first commit.
> -	test "x$(svn_cmd propget svn:executable exec1.sh)" = "x*" &&
> +	{
> +		test_have_prereq !POSIXPERM ||
> +		test "x$(svn_cmd propget svn:executable exec1.sh)" = "x*"
> +	} &&
>  	test "x$(svn_cmd propget svn:mime-type exec1.sh)" = \
>  	     "xapplication/x-shellscript" &&
>  	test "x$(svn_cmd propget svn:mime-type hello.txt)" = "xtext/plain" &&
> @@ -73,7 +82,10 @@ test_expect_success 'check resulting svn repository' '
>  	test "x$(svn_cmd propget svn:mime-type bar)" = "x" &&
>  
>  	# Check properties from second commit.
> -	test "x$(svn_cmd propget svn:executable exec2.sh)" = "x*" &&
> +	{
> +		test_have_prereq !POSIXPERM ||
> +		test "x$(svn_cmd propget svn:executable exec2.sh)" = "x*"
> +	} &&
>  	test "x$(svn_cmd propget svn:mime-type exec2.sh)" = "x" &&
>  	test "x$(svn_cmd propget svn:mime-type world.txt)" = "x" &&
>  	test "x$(svn_cmd propget svn:eol-style world.txt)" = "x" &&
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 43 of 113 in “Let Git's tests pass on Windows”
  1. 00/19 Let Git's tests pass on WindowsJohannes Schindelin, Jan 24, 2016
  2. 01/19 mingw: let's use gettext with MSYS2Johannes Schindelin, Jan 24, 2016
  3. Junio C HamanoJan 25, 2016
  4. Johannes SchindelinJan 25, 2016
  5. Junio C HamanoJan 25, 2016
  6. 02/19 mingw: do not trust MSYS2's MinGW gettext.shJohannes Schindelin, Jan 24, 2016
  7. 03/19 Git.pm: stop assuming that absolute paths start with a slashJohannes Schindelin, Jan 24, 2016
  8. 04/19 mingw: factor out Windows specific environment setupJohannes Schindelin, Jan 24, 2016
  9. 05/19 mingw: prepare the TMPDIR environment variable for shell scriptsJohannes Schindelin, Jan 24, 2016
  10. Eric SunshineJan 25, 2016
  11. Johannes SchindelinJan 26, 2016
  12. 06/19 mingw: try to delete target directory before renamingJohannes Schindelin, Jan 24, 2016
  13. Philip OakleyJan 24, 2016
  14. Johannes SchindelinJan 25, 2016
  15. Junio C HamanoJan 25, 2016
  16. Johannes SchindelinJan 26, 2016
  17. 07/19 mingw: let lstat() fail with errno == ENOTDIR when appropriateJohannes Schindelin, Jan 24, 2016
  18. 08/19 mingw: fix t5601-clone.shJohannes Schindelin, Jan 24, 2016
  19. 09/19 mingw: accomodate t0060-path-utils for MSYS2Johannes Schindelin, Jan 24, 2016
  20. Johannes SixtJan 24, 2016
  21. Johannes SchindelinJan 25, 2016
  22. 10/19 mingw: disable mkfifo-based testsJohannes Schindelin, Jan 24, 2016
  23. 11/19 tests: turn off git-daemon tests if FIFOs are not availableJohannes Schindelin, Jan 24, 2016
  24. 12/19 mingw: do not use symlinks with SVN in t9100Johannes Schindelin, Jan 24, 2016
  25. Junio C HamanoJan 25, 2016
  26. Johannes SchindelinJan 25, 2016
  27. 13/19 mingw: outsmart MSYS2's path substitution in t1508Johannes Schindelin, Jan 24, 2016
  28. Junio C HamanoJan 25, 2016
  29. Eric SunshineJan 25, 2016
  30. Junio C HamanoJan 25, 2016
  31. Johannes SchindelinJan 26, 2016
  32. Johannes SchindelinJan 25, 2016
  33. Johannes SchindelinJan 25, 2016
  34. 14/19 mingw: fix t9700's assumption about directory separatorsJohannes Schindelin, Jan 24, 2016
  35. 15/19 mingw: work around pwd issues in the testsJohannes Schindelin, Jan 24, 2016
  36. 16/19 mingw: avoid absolute path in t0008Johannes Schindelin, Jan 24, 2016
  37. Junio C HamanoJan 25, 2016
  38. Johannes SchindelinJan 25, 2016
  39. Ray DonnellyJan 25, 2016
  40. Junio C HamanoJan 25, 2016
  41. Johannes SchindelinJan 26, 2016
  42. 17/19 mingw: fix git-svn tests that expect chmod to workJohannes Schindelin, Jan 24, 2016
  43. Junio C HamanoJan 25, 2016
  44. Johannes SchindelinJan 26, 2016
  45. Junio C HamanoJan 26, 2016
  46. 18/19 mingw: skip a couple of git-svn tests that cannot pass on WindowsJohannes Schindelin, Jan 24, 2016
  47. Junio C HamanoJan 25, 2016
  48. Johannes SchindelinJan 26, 2016
  49. 19/19 mingw: do not bother to test funny file namesJohannes Schindelin, Jan 24, 2016
  50. Junio C HamanoJan 25, 2016
  51. Johannes SchindelinJan 25, 2016
  52. 00/19 Let Git's tests pass on WindowsJohannes Schindelin, Jan 26, 2016
  53. 01/19 mingw: let's use gettext with MSYS2Johannes Schindelin, Jan 26, 2016
  54. 02/19 mingw: do not trust MSYS2's MinGW gettext.shJohannes Schindelin, Jan 26, 2016
  55. 03/19 Git.pm: stop assuming that absolute paths start with a slashJohannes Schindelin, Jan 26, 2016
  56. 04/19 mingw: factor out Windows specific environment setupJohannes Schindelin, Jan 26, 2016
  57. 05/19 mingw: prepare the TMPDIR environment variable for shell scriptsJohannes Schindelin, Jan 26, 2016
  58. 06/19 mingw: try to delete target directory before renamingJohannes Schindelin, Jan 26, 2016
  59. 07/19 mingw: let lstat() fail with errno == ENOTDIR when appropriateJohannes Schindelin, Jan 26, 2016
  60. 08/19 mingw: fix t5601-clone.shJohannes Schindelin, Jan 26, 2016
  61. 09/19 mingw: accomodate t0060-path-utils for MSYS2Johannes Schindelin, Jan 26, 2016
  62. 10/19 mingw: disable mkfifo-based testsJohannes Schindelin, Jan 26, 2016
  63. 11/19 tests: turn off git-daemon tests if FIFOs are not availableJohannes Schindelin, Jan 26, 2016
  64. 12/19 mingw: skip test in t1508 that fails due to path conversionJohannes Schindelin, Jan 26, 2016
  65. Junio C HamanoJan 26, 2016
  66. Johannes SchindelinJan 27, 2016
  67. Junio C HamanoJan 27, 2016
  68. Johannes SchindelinJan 28, 2016
  69. 13/19 mingw: fix t9700's assumption about directory separatorsJohannes Schindelin, Jan 26, 2016
  70. 14/19 mingw: work around pwd issues in the testsJohannes Schindelin, Jan 26, 2016
  71. 15/19 Avoid absolute path in t0008Johannes Schindelin, Jan 26, 2016
  72. 16/19 mingw: mark t9100's test cases with appropriate prereqsJohannes Schindelin, Jan 26, 2016
  73. Junio C HamanoJan 26, 2016
  74. Johannes SchindelinJan 27, 2016
  75. 17/19 mingw: avoid illegal filename in t9118Johannes Schindelin, Jan 26, 2016
  76. 18/19 mingw: handle the missing POSIXPERM prereq in t9124Johannes Schindelin, Jan 26, 2016
  77. Junio C HamanoJan 26, 2016
  78. Johannes SchindelinJan 27, 2016
  79. 19/19 mingw: do not bother to test funny file namesJohannes Schindelin, Jan 26, 2016
  80. Eric SunshineJan 26, 2016
  81. Junio C HamanoJan 26, 2016
  82. Johannes SchindelinJan 27, 2016
  83. Junio C HamanoJan 26, 2016
  84. Johannes SchindelinJan 27, 2016
  85. Junio C HamanoJan 27, 2016
  86. 00/20 Let Git's tests pass on WindowsJohannes Schindelin, Jan 27, 2016
  87. 01/20 mingw: let's use gettext with MSYS2Johannes Schindelin, Jan 27, 2016
  88. 02/20 mingw: do not trust MSYS2's MinGW gettext.shJohannes Schindelin, Jan 27, 2016
  89. 03/20 Git.pm: stop assuming that absolute paths start with a slashJohannes Schindelin, Jan 27, 2016
  90. 04/20 mingw: factor out Windows specific environment setupJohannes Schindelin, Jan 27, 2016
  91. 05/20 mingw: prepare the TMPDIR environment variable for shell scriptsJohannes Schindelin, Jan 27, 2016
  92. 06/20 mingw: try to delete target directory before renamingJohannes Schindelin, Jan 27, 2016
  93. 07/20 mingw: let lstat() fail with errno == ENOTDIR when appropriateJohannes Schindelin, Jan 27, 2016
  94. 08/20 mingw: fix t5601-clone.shJohannes Schindelin, Jan 27, 2016
  95. 09/20 mingw: accomodate t0060-path-utils for MSYS2Johannes Schindelin, Jan 27, 2016
  96. 10/20 mingw: disable mkfifo-based testsJohannes Schindelin, Jan 27, 2016
  97. 11/20 tests: turn off git-daemon tests if FIFOs are not availableJohannes Schindelin, Jan 27, 2016
  98. Eric SunshineJan 28, 2016
  99. Johannes SchindelinJan 28, 2016
  100. Junio C HamanoJan 28, 2016
  101. 12/20 mingw: skip test in t1508 that fails due to path conversionJohannes Schindelin, Jan 27, 2016
  102. 13/20 mingw: fix t9700's assumption about directory separatorsJohannes Schindelin, Jan 27, 2016
  103. 14/20 mingw: work around pwd issues in the testsJohannes Schindelin, Jan 27, 2016
  104. 15/20 Avoid absolute path in t0008Johannes Schindelin, Jan 27, 2016
  105. 16/20 mingw: mark t9100's test cases with appropriate prereqsJohannes Schindelin, Jan 27, 2016
  106. Johannes SchindelinJan 27, 2016
  107. 17/20 mingw: avoid illegal filename in t9118Johannes Schindelin, Jan 27, 2016
  108. 18/20 mingw: handle the missing POSIXPERM prereq in t9124Johannes Schindelin, Jan 27, 2016
  109. 19/20 mingw: skip a test in t9130 that cannot pass on WindowsJohannes Schindelin, Jan 27, 2016
  110. 20/20 mingw: do not bother to test funny file namesJohannes Schindelin, Jan 27, 2016
  111. Eric SunshineJan 28, 2016
  112. Johannes SchindelinJan 28, 2016
  113. Junio C HamanoJan 28, 2016

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.