# [PATCH] t7005-editor: get rid of the SPACES_IN_FILENAMES prereq

3 messages from 2018-05-14 to 2018-05-18. Participants: SZEDER Gábor, Eric Sunshine, Jeff King.
Thread: https://gitlist.dev/t/48487

## SZEDER Gábor, 2018-05-14 10:28

Subject: [PATCH] t7005-editor: get rid of the SPACES_IN_FILENAMES prereq
Message-ID: <20180514102812.7924-1-szeder.dev@gmail.com>
URL: https://gitlist.dev/e/20180514102812.7924-1-szeder.dev%40gmail.com

```
The last two tests 'editor with a space' and 'core.editor with a
space' in 't7005-editor.sh' need the SPACES_IN_FILENAMES prereq to
ensure that they are only run on filesystems that allow, well, spaces
in filesnames.  However, we have been putting a space in the name of
the trash directory for just over a decade now, so we wouldn't be able
to run any of our tests on such a filesystem in the first place.

This prereq is therefore unnecessary, remove it.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
---
 t/t7005-editor.sh | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/t/t7005-editor.sh b/t/t7005-editor.sh
index 29e5043b94..b2ca77b338 100755
--- a/t/t7005-editor.sh
+++ b/t/t7005-editor.sh
@@ -111,14 +111,8 @@ do
 	'
 done
 
-if echo 'echo space > "$1"' > "e space.sh"
-then
-	# FS supports spaces in filenames
-	test_set_prereq SPACES_IN_FILENAMES
-fi
-
-test_expect_success SPACES_IN_FILENAMES 'editor with a space' '
-
+test_expect_success 'editor with a space' '
+	echo "echo space >\$1" >"e space.sh" &&
 	chmod a+x "e space.sh" &&
 	GIT_EDITOR="./e\ space.sh" git commit --amend &&
 	test space = "$(git show -s --pretty=format:%s)"
@@ -126,7 +120,7 @@ test_expect_success SPACES_IN_FILENAMES 'editor with a space' '
 '
 
 unset GIT_EDITOR
-test_expect_success SPACES_IN_FILENAMES 'core.editor with a space' '
+test_expect_success 'core.editor with a space' '
 
 	git config core.editor \"./e\ space.sh\" &&
 	git commit --amend &&
-- 
2.17.0.756.gcf614c5aff


```

## Eric Sunshine, 2018-05-14 17:41

Subject: Re: [PATCH] t7005-editor: get rid of the SPACES_IN_FILENAMES prereq
Message-ID: <CAPig+cRx8WZ1+DoxoJV3w+568DN=XqLMnfT8vmL8tb5FrzvWLw@mail.gmail.com>
URL: https://gitlist.dev/e/CAPig%2BcRx8WZ1%2BDoxoJV3w%2B568DN%3DXqLMnfT8vmL8tb5FrzvWLw%40mail.gmail.com
In-Reply-To: <20180514102812.7924-1-szeder.dev@gmail.com>

```
On Mon, May 14, 2018 at 6:28 AM, SZEDER Gábor <szeder.dev@gmail.com> wrote:
> The last two tests 'editor with a space' and 'core.editor with a
> space' in 't7005-editor.sh' need the SPACES_IN_FILENAMES prereq to
> ensure that they are only run on filesystems that allow, well, spaces
> in filesnames.  However, we have been putting a space in the name of

s filesnames/filenames/

> the trash directory for just over a decade now, so we wouldn't be able
> to run any of our tests on such a filesystem in the first place.
>
> This prereq is therefore unnecessary, remove it.
>
> Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>

```

## Jeff King, 2018-05-18 21:39

Subject: Re: [PATCH] t7005-editor: get rid of the SPACES_IN_FILENAMES prereq
Message-ID: <20180518213903.GC21797@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20180518213903.GC21797%40sigill.intra.peff.net
In-Reply-To: <20180514102812.7924-1-szeder.dev@gmail.com>

```
On Mon, May 14, 2018 at 12:28:12PM +0200, SZEDER Gábor wrote:

> The last two tests 'editor with a space' and 'core.editor with a
> space' in 't7005-editor.sh' need the SPACES_IN_FILENAMES prereq to
> ensure that they are only run on filesystems that allow, well, spaces
> in filesnames.  However, we have been putting a space in the name of
> the trash directory for just over a decade now, so we wouldn't be able
> to run any of our tests on such a filesystem in the first place.
> 
> This prereq is therefore unnecessary, remove it.

I wondered if there might be some platforms that tweak the test
environment in such a way that we skip the space in "trash directory".
But looking at test-lib.sh, I don't think there is any easy way to do so
(e.g., you can't just set $TEST_DIRECTORY_NAME or something). So this
does seem safe, and it's nice to reduce unnecessary complexity.

-Peff

```
