All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] some test fixes for msysGit
@ 2011-02-03 15:31 Pat Thoyts
  2011-02-03 15:31 ` [PATCH 1/4] t3509: use unconstrained initial test to setup repository Pat Thoyts
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Pat Thoyts @ 2011-02-03 15:31 UTC (permalink / raw)
  To: Git Mailing List; +Cc: msysGit, Junio C Hamano

The following patches resolve some issues for msysGit running the v1.7.4 tests

 t/t3509-cherry-pick-merge-df.sh |    6 ++++--
 t/t4120-apply-popt.sh           |    9 +++++++--
 t/t5526-fetch-submodules.sh     |   32 ++++++++++++++++++--------------
 t/t7407-submodule-foreach.sh    |    4 ++++
 4 files changed, 33 insertions(+), 18 deletions(-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/4] t3509: use unconstrained initial test to setup repository.
  2011-02-03 15:31 [PATCH] some test fixes for msysGit Pat Thoyts
@ 2011-02-03 15:31 ` Pat Thoyts
  2011-02-03 15:31 ` [PATCH 2/4] t4120-apply-popt: help systems with core.filemode=false Pat Thoyts
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Pat Thoyts @ 2011-02-03 15:31 UTC (permalink / raw)
  To: Git Mailing List; +Cc: msysGit, Junio C Hamano, Pat Thoyts

The first test did not run on msysGit due to the SYMLINKS constraint and
so subsequent tests failed because the test repository was not initialized.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
 t/t3509-cherry-pick-merge-df.sh |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/t/t3509-cherry-pick-merge-df.sh b/t/t3509-cherry-pick-merge-df.sh
index 948ca1b..df921d1 100755
--- a/t/t3509-cherry-pick-merge-df.sh
+++ b/t/t3509-cherry-pick-merge-df.sh
@@ -3,12 +3,14 @@
 test_description='Test cherry-pick with directory/file conflicts'
 . ./test-lib.sh
 
-test_expect_success SYMLINKS 'Setup rename across paths each below D/F conflicts' '
+test_expect_success 'Initialize repository' '
 	mkdir a &&
 	>a/f &&
 	git add a &&
-	git commit -m a &&
+	git commit -m a
+'
 
+test_expect_success SYMLINKS 'Setup rename across paths each below D/F conflicts' '
 	mkdir b &&
 	ln -s ../a b/a &&
 	git add b &&
-- 
1.7.4.msysgit.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/4] t4120-apply-popt: help systems with core.filemode=false
  2011-02-03 15:31 [PATCH] some test fixes for msysGit Pat Thoyts
  2011-02-03 15:31 ` [PATCH 1/4] t3509: use unconstrained initial test to setup repository Pat Thoyts
@ 2011-02-03 15:31 ` Pat Thoyts
  2011-02-03 15:31 ` [PATCH 3/4] t7407: fix line endings for mingw build Pat Thoyts
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Pat Thoyts @ 2011-02-03 15:31 UTC (permalink / raw)
  To: Git Mailing List; +Cc: msysGit, Junio C Hamano, Johannes Sixt, Pat Thoyts

From: Johannes Sixt <j6t@kdbg.org>

A test case verifies that filemode-only patches work as expected. Help
systems where "test -x" does not work by applying the test patch also to
the index, where the effects can be verified even on such systems.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
 t/t4120-apply-popt.sh |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/t/t4120-apply-popt.sh b/t/t4120-apply-popt.sh
index 579c9e6..a33d510 100755
--- a/t/t4120-apply-popt.sh
+++ b/t/t4120-apply-popt.sh
@@ -6,6 +6,7 @@
 test_description='git apply -p handling.'
 
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
 test_expect_success setup '
 	mkdir sub &&
@@ -62,8 +63,12 @@ test_expect_success 'apply (-p2) diff, mode change only' '
 	old mode 100644
 	new mode 100755
 	EOF
-	chmod 644 file1 &&
-	git apply -p2 patch.chmod &&
+	test_chmod -x file1 &&
+	git apply --index -p2 patch.chmod &&
+	case $(git ls-files -s file1) in 100755*) : good;; *) false;; esac
+'
+
+test_expect_success FILEMODE 'file mode was changed' '
 	test -x file1
 '
 
-- 
1.7.4.msysgit.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/4] t7407: fix line endings for mingw build
  2011-02-03 15:31 [PATCH] some test fixes for msysGit Pat Thoyts
  2011-02-03 15:31 ` [PATCH 1/4] t3509: use unconstrained initial test to setup repository Pat Thoyts
  2011-02-03 15:31 ` [PATCH 2/4] t4120-apply-popt: help systems with core.filemode=false Pat Thoyts
@ 2011-02-03 15:31 ` Pat Thoyts
  2011-02-03 15:31 ` [PATCH 4/4] t5526: avoid dependency on submodule order Pat Thoyts
  2011-02-03 16:29 ` [msysGit] [PATCH] some test fixes for msysGit Johannes Schindelin
  4 siblings, 0 replies; 11+ messages in thread
From: Pat Thoyts @ 2011-02-03 15:31 UTC (permalink / raw)
  To: Git Mailing List; +Cc: msysGit, Junio C Hamano, Pat Thoyts

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
 t/t7407-submodule-foreach.sh |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh
index 1d67ef5..4c84764 100755
--- a/t/t7407-submodule-foreach.sh
+++ b/t/t7407-submodule-foreach.sh
@@ -254,6 +254,10 @@ test_expect_success 'ensure "status --cached --recursive" preserves the --cached
 		) &&
 		git submodule status --cached --recursive -- nested1 > ../actual
 	) &&
+	if test_have_prereq MINGW
+	then
+		dos2unix actual
+	fi &&
 	test_cmp expect actual
 '
 
-- 
1.7.4.msysgit.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/4] t5526: avoid dependency on submodule order
  2011-02-03 15:31 [PATCH] some test fixes for msysGit Pat Thoyts
                   ` (2 preceding siblings ...)
  2011-02-03 15:31 ` [PATCH 3/4] t7407: fix line endings for mingw build Pat Thoyts
@ 2011-02-03 15:31 ` Pat Thoyts
  2011-02-03 20:08   ` [msysGit] " Johannes Sixt
  2011-02-03 16:29 ` [msysGit] [PATCH] some test fixes for msysGit Johannes Schindelin
  4 siblings, 1 reply; 11+ messages in thread
From: Pat Thoyts @ 2011-02-03 15:31 UTC (permalink / raw)
  To: Git Mailing List; +Cc: msysGit, Junio C Hamano, Pat Thoyts

When running tests on msysGit the actual results appear in the reverse
order. Added a test_cmp_unordered to test that each expected line is
present in the output without depending upon the order of lines.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
 t/t5526-fetch-submodules.sh |   32 ++++++++++++++++++--------------
 1 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
index 884a5e5..d218845 100755
--- a/t/t5526-fetch-submodules.sh
+++ b/t/t5526-fetch-submodules.sh
@@ -32,6 +32,10 @@ add_upstream_commit() {
 	)
 }
 
+test_cmp_unordered() {
+	grep --line-regexp -f "$@" >&3
+}
+
 test_expect_success setup '
 	mkdir deepsubmodule &&
 	(
@@ -67,8 +71,8 @@ test_expect_success "fetch --recurse-submodules recurses into submodules" '
 		cd downstream &&
 		git fetch --recurse-submodules >../actual.out 2>../actual.err
 	) &&
-	test_cmp expect.out actual.out &&
-	test_cmp expect.err actual.err
+	test_cmp_unordered expect.out actual.out &&
+	test_cmp_unordered expect.err actual.err
 '
 
 test_expect_success "fetch alone only fetches superproject" '
@@ -96,8 +100,8 @@ test_expect_success "using fetchRecurseSubmodules=true in .gitmodules recurses i
 		git config -f .gitmodules submodule.submodule.fetchRecurseSubmodules true &&
 		git fetch >../actual.out 2>../actual.err
 	) &&
-	test_cmp expect.out actual.out &&
-	test_cmp expect.err actual.err
+	test_cmp_unordered expect.out actual.out &&
+	test_cmp_unordered expect.err actual.err
 '
 
 test_expect_success "--no-recurse-submodules overrides .gitmodules config" '
@@ -127,8 +131,8 @@ test_expect_success "--recurse-submodules overrides fetchRecurseSubmodules setti
 		git config -f --unset .gitmodules submodule.submodule.fetchRecurseSubmodules true &&
 		git config --unset submodule.submodule.fetchRecurseSubmodules
 	) &&
-	test_cmp expect.out actual.out &&
-	test_cmp expect.err actual.err
+	test_cmp_unordered expect.out actual.out &&
+	test_cmp_unordered expect.err actual.err
 '
 
 test_expect_success "--quiet propagates to submodules" '
@@ -146,14 +150,14 @@ test_expect_success "--dry-run propagates to submodules" '
 		cd downstream &&
 		git fetch --recurse-submodules --dry-run >../actual.out 2>../actual.err
 	) &&
-	test_cmp expect.out actual.out &&
-	test_cmp expect.err actual.err &&
+	test_cmp_unordered expect.out actual.out &&
+	test_cmp_unordered expect.err actual.err &&
 	(
 		cd downstream &&
 		git fetch --recurse-submodules >../actual.out 2>../actual.err
 	) &&
-	test_cmp expect.out actual.out &&
-	test_cmp expect.err actual.err
+	test_cmp_unordered expect.out actual.out &&
+	test_cmp_unordered expect.err actual.err
 '
 
 test_expect_success "recurseSubmodules=true propagates into submodules" '
@@ -163,8 +167,8 @@ test_expect_success "recurseSubmodules=true propagates into submodules" '
 		git config fetch.recurseSubmodules true
 		git fetch >../actual.out 2>../actual.err
 	) &&
-	test_cmp expect.out actual.out &&
-	test_cmp expect.err actual.err
+	test_cmp_unordered expect.out actual.out &&
+	test_cmp_unordered expect.err actual.err
 '
 
 test_expect_success "--recurse-submodules overrides config in submodule" '
@@ -177,8 +181,8 @@ test_expect_success "--recurse-submodules overrides config in submodule" '
 		) &&
 		git fetch --recurse-submodules >../actual.out 2>../actual.err
 	) &&
-	test_cmp expect.out actual.out &&
-	test_cmp expect.err actual.err
+	test_cmp_unordered expect.out actual.out &&
+	test_cmp_unordered expect.err actual.err
 '
 
 test_expect_success "--no-recurse-submodules overrides config setting" '
-- 
1.7.4.msysgit.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [msysGit] [PATCH] some test fixes for msysGit
  2011-02-03 15:31 [PATCH] some test fixes for msysGit Pat Thoyts
                   ` (3 preceding siblings ...)
  2011-02-03 15:31 ` [PATCH 4/4] t5526: avoid dependency on submodule order Pat Thoyts
@ 2011-02-03 16:29 ` Johannes Schindelin
  4 siblings, 0 replies; 11+ messages in thread
From: Johannes Schindelin @ 2011-02-03 16:29 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: Git Mailing List, msysGit, Junio C Hamano

Hi,

On Thu, 3 Feb 2011, Pat Thoyts wrote:

> The following patches resolve some issues for msysGit running the v1.7.4 
> tests
> 
>  t/t3509-cherry-pick-merge-df.sh |    6 ++++--
>  t/t4120-apply-popt.sh           |    9 +++++++--
>  t/t5526-fetch-submodules.sh     |   32 ++++++++++++++++++--------------
>  t/t7407-submodule-foreach.sh    |    4 ++++
>  4 files changed, 33 insertions(+), 18 deletions(-)

I looked at the first three and think they are obviously fine.

As I mentioned, I would like to have a fix for the order in git-submodule. 
If you do not have the time, I will try to push aside some of the work I 
have to do here and investigate myself.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [msysGit] [PATCH 4/4] t5526: avoid dependency on submodule order
  2011-02-03 15:31 ` [PATCH 4/4] t5526: avoid dependency on submodule order Pat Thoyts
@ 2011-02-03 20:08   ` Johannes Sixt
  2011-02-03 20:26     ` Johannes Schindelin
  0 siblings, 1 reply; 11+ messages in thread
From: Johannes Sixt @ 2011-02-03 20:08 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: msysgit, Git Mailing List, Junio C Hamano

On Donnerstag, 3. Februar 2011, Pat Thoyts wrote:
> +test_cmp_unordered() {
> +	grep --line-regexp -f "$@" >&3
> +}

I don't think that this is sufficiently portable.

Furthermore, just like Dscho, I'd rather prefer to know why the output is not 
ordered as expected.

I'm fine with the other patches as well.

A side note regarding SYMLINKS: It's actually possible to remove 70 of the 130 
SYMLINKS checks from the test suite:

http://repo.or.cz/w/git/mingw/j6t.git/shortlog/refs/heads/war-on-symlinks

-- Hannes

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [msysGit] [PATCH 4/4] t5526: avoid dependency on submodule order
  2011-02-03 20:08   ` [msysGit] " Johannes Sixt
@ 2011-02-03 20:26     ` Johannes Schindelin
  2011-02-03 20:56       ` Johannes Sixt
  2011-02-04  8:41       ` [PATCH maint] start_command: flush buffers in the WIN32 code path as well Johannes Sixt
  0 siblings, 2 replies; 11+ messages in thread
From: Johannes Schindelin @ 2011-02-03 20:26 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Pat Thoyts, msysgit, Git Mailing List, Junio C Hamano

Hi,

On Thu, 3 Feb 2011, Johannes Sixt wrote:

> On Donnerstag, 3. Februar 2011, Pat Thoyts wrote:
> > +test_cmp_unordered() {
> > +	grep --line-regexp -f "$@" >&3
> > +}
> 
> I don't think that this is sufficiently portable.
> 
> Furthermore, just like Dscho, I'd rather prefer to know why the output 
> is not ordered as expected.

Have you seen my response where I proved that it is a fflush() issue, most 
likely with mingw_spawn()?

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [msysGit] [PATCH 4/4] t5526: avoid dependency on submodule order
  2011-02-03 20:26     ` Johannes Schindelin
@ 2011-02-03 20:56       ` Johannes Sixt
  2011-02-04  8:41       ` [PATCH maint] start_command: flush buffers in the WIN32 code path as well Johannes Sixt
  1 sibling, 0 replies; 11+ messages in thread
From: Johannes Sixt @ 2011-02-03 20:56 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Pat Thoyts, msysgit, Git Mailing List, Junio C Hamano

On Donnerstag, 3. Februar 2011, Johannes Schindelin wrote:
> On Thu, 3 Feb 2011, Johannes Sixt wrote:
> > Furthermore, just like Dscho, I'd rather prefer to know why the output
> > is not ordered as expected.
>
> Have you seen my response where I proved that it is a fflush() issue, most
> likely with mingw_spawn()?

Obviously, I haven't. Good catch!

-- Hannes

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH maint] start_command: flush buffers in the WIN32 code path as well
  2011-02-03 20:26     ` Johannes Schindelin
  2011-02-03 20:56       ` Johannes Sixt
@ 2011-02-04  8:41       ` Johannes Sixt
  2011-02-04 11:23         ` Pat Thoyts
  1 sibling, 1 reply; 11+ messages in thread
From: Johannes Sixt @ 2011-02-04  8:41 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Pat Thoyts, msysgit, Git Mailing List, Junio C Hamano

From: Johannes Sixt <j6t@kdbg.org>

The POSIX code path did The Right Thing already, but we have to do the same
on Windows.

This bug caused failures in t5526-fetch-submodules, where the output of
'git fetch --recurse-submodules' was in the wrong order.

Debugged-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
Am 2/3/2011 21:26, schrieb Johannes Schindelin:
> Have you seen my response where I proved that it is a fflush() issue, most 
> likely with mingw_spawn()?

I think this is the correct fix.

 run-command.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/run-command.c b/run-command.c
index 2a1041e..f91e446 100644
--- a/run-command.c
+++ b/run-command.c
@@ -194,6 +194,7 @@ fail_pipe:
 	}
 
 	trace_argv_printf(cmd->argv, "trace: run_command:");
+	fflush(NULL);
 
 #ifndef WIN32
 {
@@ -201,7 +202,6 @@ fail_pipe:
 	if (pipe(notify_pipe))
 		notify_pipe[0] = notify_pipe[1] = -1;
 
-	fflush(NULL);
 	cmd->pid = fork();
 	if (!cmd->pid) {
 		/*
-- 
1.7.4.1253.g00c7

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH maint] start_command: flush buffers in the WIN32 code path as well
  2011-02-04  8:41       ` [PATCH maint] start_command: flush buffers in the WIN32 code path as well Johannes Sixt
@ 2011-02-04 11:23         ` Pat Thoyts
  0 siblings, 0 replies; 11+ messages in thread
From: Pat Thoyts @ 2011-02-04 11:23 UTC (permalink / raw)
  To: Johannes Sixt
  Cc: Johannes Schindelin, msysgit, Git Mailing List, Junio C Hamano

Johannes Sixt <j.sixt@viscovery.net> writes:

>From: Johannes Sixt <j6t@kdbg.org>
>
>The POSIX code path did The Right Thing already, but we have to do the same
>on Windows.
>
>This bug caused failures in t5526-fetch-submodules, where the output of
>'git fetch --recurse-submodules' was in the wrong order.
>
>Debugged-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
>Signed-off-by: Johannes Sixt <j6t@kdbg.org>
>---
>Am 2/3/2011 21:26, schrieb Johannes Schindelin:
>> Have you seen my response where I proved that it is a fflush() issue, most 
>> likely with mingw_spawn()?
>
>I think this is the correct fix.
>
> run-command.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>diff --git a/run-command.c b/run-command.c
>index 2a1041e..f91e446 100644
>--- a/run-command.c
>+++ b/run-command.c
>@@ -194,6 +194,7 @@ fail_pipe:
> 	}
> 
> 	trace_argv_printf(cmd->argv, "trace: run_command:");
>+	fflush(NULL);
> 
> #ifndef WIN32
> {
>@@ -201,7 +202,6 @@ fail_pipe:
> 	if (pipe(notify_pipe))
> 		notify_pipe[0] = notify_pipe[1] = -1;
> 
>-	fflush(NULL);
> 	cmd->pid = fork();
> 	if (!cmd->pid) {
> 		/*

This fixes the issue for me on msysGit. Thanks.

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-02-04 11:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-03 15:31 [PATCH] some test fixes for msysGit Pat Thoyts
2011-02-03 15:31 ` [PATCH 1/4] t3509: use unconstrained initial test to setup repository Pat Thoyts
2011-02-03 15:31 ` [PATCH 2/4] t4120-apply-popt: help systems with core.filemode=false Pat Thoyts
2011-02-03 15:31 ` [PATCH 3/4] t7407: fix line endings for mingw build Pat Thoyts
2011-02-03 15:31 ` [PATCH 4/4] t5526: avoid dependency on submodule order Pat Thoyts
2011-02-03 20:08   ` [msysGit] " Johannes Sixt
2011-02-03 20:26     ` Johannes Schindelin
2011-02-03 20:56       ` Johannes Sixt
2011-02-04  8:41       ` [PATCH maint] start_command: flush buffers in the WIN32 code path as well Johannes Sixt
2011-02-04 11:23         ` Pat Thoyts
2011-02-03 16:29 ` [msysGit] [PATCH] some test fixes for msysGit Johannes Schindelin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.