* [GSOC][PATCH v2] t1300: convert "test -f" with "test_path_is_file"
@ 2020-03-20 15:56 Adrian Wijaya
0 siblings, 0 replies; 4+ messages in thread
From: Adrian Wijaya @ 2020-03-20 15:56 UTC (permalink / raw)
To: git; +Cc: Adrian Wijaya
Convert "test -f" with "test_path_is_file" to give more verbose
test output on failure.
Signed-off-by: Adrian Wijaya <adrianwijaya100@gmail.com>
---
t/t1300-config.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index 97ebfe1f9d..d74554fc09 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -1020,11 +1020,11 @@ test_expect_success SYMLINKS 'symlinked configuration' '
ln -s notyet myconfig &&
git config --file=myconfig test.frotz nitfol &&
test -h myconfig &&
- test -f notyet &&
+ test_path_is_file notyet &&
test "z$(git config --file=notyet test.frotz)" = znitfol &&
git config --file=myconfig test.xyzzy rezrov &&
test -h myconfig &&
- test -f notyet &&
+ test_path_is_file notyet &&
cat >expect <<-\EOF &&
nitfol
rezrov
--
2.26.0.rc1.11.g30e9940356
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [GSOC][PATCH 1/2] t1300: replace "test -f" into "test_path_is_file"
@ 2020-03-20 15:45 adrian wijaya
2020-03-20 16:07 ` [GSOC][PATCH v2] t1300: convert "test -f" with "test_path_is_file" Adrian Wijaya
0 siblings, 1 reply; 4+ messages in thread
From: adrian wijaya @ 2020-03-20 15:45 UTC (permalink / raw)
To: git
From 5fb689207ebe06b5f4c506b0b184c95a8a2e529d Mon Sep 17 00:00:00 2001
From: Adrian Wijaya <adrianwijaya100@gmail.com>
Date: Thu, 19 Mar 2020 21:13:44 +0700
Subject: [GSOC][PATCH v2] t1300: convert "test -f" with "test_path_is_file"
Convert "test -f" with "test_path_is_file" to give more verbose
test output on failure.
Signed-off-by: Adrian Wijaya <adrianwijaya100@gmail.com>
---
t/t1300-config.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index 97ebfe1f9d..d74554fc09 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -1020,11 +1020,11 @@ test_expect_success SYMLINKS 'symlinked configuration' '
ln -s notyet myconfig &&
git config --file=myconfig test.frotz nitfol &&
test -h myconfig &&
- test -f notyet &&
+ test_path_is_file notyet &&
test "z$(git config --file=notyet test.frotz)" = znitfol &&
git config --file=myconfig test.xyzzy rezrov &&
test -h myconfig &&
- test -f notyet &&
+ test_path_is_file notyet &&
cat >expect <<-\EOF &&
nitfol
rezrov
--
2.26.0.rc1.11.g30e9940356
On Fri, Mar 20, 2020 at 6:47 AM Adrian Wijaya <adrianwijaya100@gmail.com> wrote:
>
> Dear all,
>
> In this year, I intend to apply in git for GSoC 2020. This is actually my
> first contribution to the git community. I am a sophomore Computer Science
> student at University of Indonesia.
>
> In this patch, I have replaced 'test -f' into 'test_path_is_file' function
> (can be found in test-lib-functions).
>
> Suggestions and advice are very welcome.
>
> Regards,
> Adrian Wijaya
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [GSOC][PATCH v2] t1300: convert "test -f" with "test_path_is_file"
2020-03-20 15:45 [GSOC][PATCH 1/2] t1300: replace "test -f" into "test_path_is_file" adrian wijaya
@ 2020-03-20 16:07 ` Adrian Wijaya
2020-03-20 18:04 ` Junio C Hamano
2020-03-20 18:08 ` Junio C Hamano
0 siblings, 2 replies; 4+ messages in thread
From: Adrian Wijaya @ 2020-03-20 16:07 UTC (permalink / raw)
To: git; +Cc: peff, Adrian Wijaya
Convert "test -f" with "test_path_is_file" to give more verbose
test output on failure.
Signed-off-by: Adrian Wijaya <adrianwijaya100@gmail.com>
---
t/t1300-config.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index 97ebfe1f9d..d74554fc09 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -1020,11 +1020,11 @@ test_expect_success SYMLINKS 'symlinked configuration' '
ln -s notyet myconfig &&
git config --file=myconfig test.frotz nitfol &&
test -h myconfig &&
- test -f notyet &&
+ test_path_is_file notyet &&
test "z$(git config --file=notyet test.frotz)" = znitfol &&
git config --file=myconfig test.xyzzy rezrov &&
test -h myconfig &&
- test -f notyet &&
+ test_path_is_file notyet &&
cat >expect <<-\EOF &&
nitfol
rezrov
--
2.26.0.rc1.11.g30e9940356
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [GSOC][PATCH v2] t1300: convert "test -f" with "test_path_is_file"
2020-03-20 16:07 ` [GSOC][PATCH v2] t1300: convert "test -f" with "test_path_is_file" Adrian Wijaya
@ 2020-03-20 18:04 ` Junio C Hamano
2020-03-20 18:08 ` Junio C Hamano
1 sibling, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2020-03-20 18:04 UTC (permalink / raw)
To: Adrian Wijaya; +Cc: git, peff
Adrian Wijaya <adrianwijaya100@gmail.com> writes:
> Subject: Re: [GSOC][PATCH v2] t1300: convert "test -f" with "test_path_is_file"
I thought the suggestion was either "replace with" or "convert
into", but the above looks a bit funny cross between them. I'd
probably go with "replace".
> Convert "test -f" with "test_path_is_file" to give more verbose
> test output on failure.
Likewise, but the first part is already said in the title. So
Subject: t1300: replace "test -f" with "test_path_is_file"
This way, the test will not fail silently, making it easier
to diagnose.
or something like that, perhaps.
> Signed-off-by: Adrian Wijaya <adrianwijaya100@gmail.com>
> ---
> t/t1300-config.sh | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/t/t1300-config.sh b/t/t1300-config.sh
> index 97ebfe1f9d..d74554fc09 100755
> --- a/t/t1300-config.sh
> +++ b/t/t1300-config.sh
> @@ -1020,11 +1020,11 @@ test_expect_success SYMLINKS 'symlinked configuration' '
> ln -s notyet myconfig &&
> git config --file=myconfig test.frotz nitfol &&
> test -h myconfig &&
> - test -f notyet &&
> + test_path_is_file notyet &&
> test "z$(git config --file=notyet test.frotz)" = znitfol &&
> git config --file=myconfig test.xyzzy rezrov &&
> test -h myconfig &&
> - test -f notyet &&
> + test_path_is_file notyet &&
> cat >expect <<-\EOF &&
> nitfol
> rezrov
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [GSOC][PATCH v2] t1300: convert "test -f" with "test_path_is_file"
2020-03-20 16:07 ` [GSOC][PATCH v2] t1300: convert "test -f" with "test_path_is_file" Adrian Wijaya
2020-03-20 18:04 ` Junio C Hamano
@ 2020-03-20 18:08 ` Junio C Hamano
1 sibling, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2020-03-20 18:08 UTC (permalink / raw)
To: git; +Cc: peff, Adrian Wijaya
Adrian Wijaya <adrianwijaya100@gmail.com> writes:
> test "z$(git config --file=notyet test.frotz)" = znitfol &&
We see 130+ instances of this rather antiquated construct that
presumably avoids to compare an empty string with something else
using "test X = Y" tool. It might have been a good idea in 2005 (I
do not remember why we started doing this), but perhaps it is time
to clean them up by listing it as another microproject idea for the
next year?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-03-20 18:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-20 15:56 [GSOC][PATCH v2] t1300: convert "test -f" with "test_path_is_file" Adrian Wijaya
-- strict thread matches above, loose matches on Subject: below --
2020-03-20 15:45 [GSOC][PATCH 1/2] t1300: replace "test -f" into "test_path_is_file" adrian wijaya
2020-03-20 16:07 ` [GSOC][PATCH v2] t1300: convert "test -f" with "test_path_is_file" Adrian Wijaya
2020-03-20 18:04 ` Junio C Hamano
2020-03-20 18:08 ` Junio C Hamano
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).