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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:07:53

Johannes Schindelin [off-list ref] writes:
From: 마누엘 <redacted>

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.


quoted hunk
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: 마누엘 <redacted>
Signed-off-by: Johannes Schindelin <redacted>
---
 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" &&

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

From: Johannes Schindelin <hidden>
Date: 2016-06-15 23:07:53

Hi Junio,

On Sun, 24 Jan 2016, Junio C Hamano wrote:
Johannes Schindelin [off-list ref] writes:
quoted
From: 마누엘 <redacted>

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.
This is my fault: there are two MINGW prereqs, and they guard against
trying to work with file names ending in a dot (which is illegal on
Windows' file systems).

My original plan was to split the patch into two, but I actually reworked
the patch from scratch.
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.
I agree that this is not desirable, and I changed it where possible to
simply skip the entire test case. In some cases, however, the 'setup' test
case was affected, and of course we cannot skip that one, else everything
falls apart.

The result of my work consists of these three patches (which will be part
of v2):

	https://github.com/dscho/git/compare/ea813597~3...ea813597

Thanks,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help