git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Fixes for tests run without perl
@ 2013-08-24  3:30 Kacper Kornet
  2013-08-24  3:30 ` [PATCH 1/3] Make test "using invalid commit with -C" more strict Kacper Kornet
  0 siblings, 1 reply; 6+ messages in thread
From: Kacper Kornet @ 2013-08-24  3:30 UTC (permalink / raw)
  To: git

This is a set of fixes for problems found while running
test suite without perl installed.

Kacper

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

* [PATCH 1/3] Make test "using invalid commit with -C" more strict
  2013-08-24  3:30 [PATCH 0/3] Fixes for tests run without perl Kacper Kornet
@ 2013-08-24  3:30 ` Kacper Kornet
  0 siblings, 0 replies; 6+ messages in thread
From: Kacper Kornet @ 2013-08-24  3:30 UTC (permalink / raw)
  To: git; +Cc: Kacper Kornet

In the test 'using invalid commit with -C' git-commit would have failed
even if the -C option  had been given the correct commit, as there was
nothing to commit. Fix it by making sure there is always something to
commit and git-commit fails because of the invalid commit provided to
it.

Signed-off-by: Kacper Kornet <draenog@pld-linux.org>
---
 t/t7501-commit.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 99ce36f..699a603 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -53,7 +53,10 @@ test_expect_success PERL 'can use paths with --interactive' '
 '
 
 test_expect_success 'using invalid commit with -C' '
-	test_must_fail git commit -C bogus
+	echo bong >file &&
+	git add file &&
+	test_must_fail git commit -C bogus &&
+	git reset
 '
 
 test_expect_success 'nothing to commit' '
-- 
1.8.3.4


>From 8ad7ef374e1b05cb73d6cf445c44f10e5ec36be3 Mon Sep 17 00:00:00 2001
From: Kacper Kornet <draenog@pld-linux.org>
Date: Sat, 24 Aug 2013 03:58:05 +0100
Subject: [PATCH 2/3] t/t3701-add-interactive.sh: Add PERL prerequisite

The test 'patch mode ignores unmerged entries' uses git-add -p, so it
depends on the perl code.

Signed-off-by: Kacper Kornet <draenog@pld-linux.org>
---
 t/t3701-add-interactive.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index 9fab25c..8514220 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -330,7 +330,7 @@ test_expect_success PERL 'split hunk "add -p (edit)"' '
 	! grep "^+15" actual
 '
 
-test_expect_success 'patch mode ignores unmerged entries' '
+test_expect_success PERL 'patch mode ignores unmerged entries' '
 	git reset --hard &&
 	test_commit conflict &&
 	test_commit non-conflict &&
-- 
1.8.3.4


>From 14f135b178bfaba67653bc3bedf65ec45e38bc76 Mon Sep 17 00:00:00 2001
From: Kacper Kornet <draenog@pld-linux.org>
Date: Sat, 24 Aug 2013 04:01:02 +0100
Subject: [PATCH 3/3] t/t7106-reset-unborn-branch.sh: Add PERL prerequisite

The test 'reset -p' uses git-reset -p, so it depends on the perl code.

Signed-off-by: Kacper Kornet <draenog@pld-linux.org>
---
 t/t7106-reset-unborn-branch.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t7106-reset-unborn-branch.sh b/t/t7106-reset-unborn-branch.sh
index 8062cf5..499cd88 100755
--- a/t/t7106-reset-unborn-branch.sh
+++ b/t/t7106-reset-unborn-branch.sh
@@ -27,7 +27,7 @@ test_expect_success 'reset $file' '
 	test "$(git ls-files)" = "b"
 '
 
-test_expect_success 'reset -p' '
+test_expect_success PERL 'reset -p' '
 	rm .git/index &&
 	git add a &&
 	echo y | git reset -p &&
-- 
1.8.3.4

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

* [PATCH 1/3] Make test "using invalid commit with -C" more strict
  2013-08-24  4:01 [PATCH 0/3] Fixes for tests run without perl Kacper Kornet
@ 2013-08-24  4:01 ` Kacper Kornet
  2013-08-24 20:01   ` Jonathan Nieder
  0 siblings, 1 reply; 6+ messages in thread
From: Kacper Kornet @ 2013-08-24  4:01 UTC (permalink / raw)
  To: git

In the test 'using invalid commit with -C' git-commit would have failed
even if the -C option  had been given the correct commit, as there was
nothing to commit. Fix it by making sure there is always something to
commit and git-commit fails because of the invalid commit provided to
it.

Signed-off-by: Kacper Kornet <draenog@pld-linux.org>
---
 t/t7501-commit.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 99ce36f..699a603 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -53,7 +53,10 @@ test_expect_success PERL 'can use paths with --interactive' '
 '
 
 test_expect_success 'using invalid commit with -C' '
-	test_must_fail git commit -C bogus
+	echo bong >file &&
+	git add file &&
+	test_must_fail git commit -C bogus &&
+	git reset
 '
 
 test_expect_success 'nothing to commit' '
-- 
1.8.3.4

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

* Re: [PATCH 1/3] Make test "using invalid commit with -C" more strict
  2013-08-24  4:01 ` [PATCH 1/3] Make test "using invalid commit with -C" more strict Kacper Kornet
@ 2013-08-24 20:01   ` Jonathan Nieder
  2013-08-25  6:38     ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Nieder @ 2013-08-24 20:01 UTC (permalink / raw)
  To: Kacper Kornet; +Cc: git

Kacper Kornet wrote:

> In the test 'using invalid commit with -C' git-commit would have failed
> even if the -C option  had been given the correct commit, as there was
> nothing to commit.

Good catch.

[...]
> --- a/t/t7501-commit.sh
> +++ b/t/t7501-commit.sh
> @@ -53,7 +53,10 @@ test_expect_success PERL 'can use paths with --interactive' '
>  '
>  
>  test_expect_success 'using invalid commit with -C' '
> -	test_must_fail git commit -C bogus
> +	echo bong >file &&
> +	git add file &&
> +	test_must_fail git commit -C bogus &&
> +	git reset

I guess to be pedantic this should say

	echo bong >file &&
	git add file &&
	test_when_finished "git reset --hard" &&
	test_must_fail git commit -C bogus

to avoid interfering with later tests even when this one fails and
the && prevents the 'git reset' from being executed.

With or without that change,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

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

* Re: [PATCH 1/3] Make test "using invalid commit with -C" more strict
  2013-08-24 20:01   ` Jonathan Nieder
@ 2013-08-25  6:38     ` Junio C Hamano
  2013-08-25  6:40       ` Jonathan Nieder
  0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2013-08-25  6:38 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Kacper Kornet, git

Jonathan Nieder <jrnieder@gmail.com> writes:

> Kacper Kornet wrote:
>
>> In the test 'using invalid commit with -C' git-commit would have failed
>> even if the -C option  had been given the correct commit, as there was
>> nothing to commit.
>
> Good catch.
>
> [...]
>> --- a/t/t7501-commit.sh
>> +++ b/t/t7501-commit.sh
>> @@ -53,7 +53,10 @@ test_expect_success PERL 'can use paths with --interactive' '
>>  '
>>  
>>  test_expect_success 'using invalid commit with -C' '
>> -	test_must_fail git commit -C bogus
>> +	echo bong >file &&
>> +	git add file &&
>> +	test_must_fail git commit -C bogus &&
>> +	git reset
>
> I guess to be pedantic this should say
>
> 	echo bong >file &&
> 	git add file &&
> 	test_when_finished "git reset --hard" &&
> 	test_must_fail git commit -C bogus
>
> to avoid interfering with later tests even when this one fails and
> the && prevents the 'git reset' from being executed.

Makes sense.

Also it would be much simpler to say "git commit --allow-empty".

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

* Re: [PATCH 1/3] Make test "using invalid commit with -C" more strict
  2013-08-25  6:38     ` Junio C Hamano
@ 2013-08-25  6:40       ` Jonathan Nieder
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Nieder @ 2013-08-25  6:40 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Kacper Kornet, git

Junio C Hamano wrote:
>> Kacper Kornet wrote:

>>> In the test 'using invalid commit with -C' git-commit would have failed
>>> even if the -C option  had been given the correct commit, as there was
>>> nothing to commit.
[...]
> Also it would be much simpler to say "git commit --allow-empty".

Sounds good. ;-)

Thanks,
Jonathan

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

end of thread, other threads:[~2013-08-25  6:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-24  3:30 [PATCH 0/3] Fixes for tests run without perl Kacper Kornet
2013-08-24  3:30 ` [PATCH 1/3] Make test "using invalid commit with -C" more strict Kacper Kornet
  -- strict thread matches above, loose matches on Subject: below --
2013-08-24  4:01 [PATCH 0/3] Fixes for tests run without perl Kacper Kornet
2013-08-24  4:01 ` [PATCH 1/3] Make test "using invalid commit with -C" more strict Kacper Kornet
2013-08-24 20:01   ` Jonathan Nieder
2013-08-25  6:38     ` Junio C Hamano
2013-08-25  6:40       ` Jonathan Nieder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).