Re: [PATCH v3 1/4] test-lib-functions: normalize test_path_is_missing() debugging
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 29, 2021, 03:49 UTC
- Message-ID
- <xmqqr1it92da.fsf@gitster.g>
- In-Reply-To
- <patch-1.4-26a3d552d88-20210423T072824Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> Change the test_path_is_missing() to be consistent with related > functions.
Not very helpful to readers. It is totally unclear what kind of consistency is being sought by this patch.
> Since 2caf20c52b7 (test-lib: user-friendly alternatives to > test [-d|-f|-e], 2010-08-10) we've been ls -ld-ing the bad path and > echo-ing $* if it exists.
Yes, and it does not explain what's wrong with that behaviour.
If there were something like "... but no invocation of the shell function passes $2 and subsequent arguments" (I didn't check if that is the case) after the above, it might have been more understandable, though.
> Let's just say that it exists instead.
As the earlier parts of the proposed log message are so weak, this conclusion does not sound convincing.
Show 23 quoted lines
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
> t/test-lib-functions.sh | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
> index 213b1988aa4..2914b398470 100644
> --- a/t/test-lib-functions.sh
> +++ b/t/test-lib-functions.sh
> @@ -810,12 +810,7 @@ test_path_is_missing () {
> test "$#" -ne 1 && BUG "1 param"
> if test -e "$1"
> then
> - echo "Path exists:"
> - ls -ld "$1"
> - if test $# -ge 1
> - then
> - echo "$*"
> - fi
> + echo "Path $1 exists!"
> false
> fi
> }