git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: James <rouzier@gmail.com>
Cc: git@vger.kernel.org, sunshine@sunshineco.com
Subject: Re: [PATCH v2 1/2] modernize t7300
Date: Mon, 07 Dec 2015 13:40:34 -0800	[thread overview]
Message-ID: <xmqq610alyy5.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <1449413906-23256-1-git-send-email-rouzier@gmail.com> (James's message of "Sun, 6 Dec 2015 09:58:25 -0500")

James <rouzier@gmail.com> writes:

> From: James Rouzier <rouzier@gmail.com>
>
> ---

Missing sign-off.

>  t/t7300-clean.sh | 382 +++++++++++++++++++++++++++----------------------------
>  1 file changed, 190 insertions(+), 192 deletions(-)
>
> diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
> index 86ceb38..d555bb6 100755
> --- a/t/t7300-clean.sh
> +++ b/t/t7300-clean.sh
> @@ -28,15 +28,15 @@ test_expect_success 'git clean with skip-worktree .gitignore' '
>  	mkdir -p build docs &&
>  	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
>  	git clean &&
> -	test -f Makefile &&
> -	test -f README &&
> -	test -f src/part1.c &&
> -	test -f src/part2.c &&
> -	test ! -f a.out &&
> -	test ! -f src/part3.c &&
> -	test -f docs/manual.txt &&
> -	test -f obj.o &&
> -	test -f build/lib.so &&
> +	test_path_is_file Makefile &&
> +	test_path_is_file README &&
> +	test_path_is_file src/part1.c &&
> +	test_path_is_file src/part2.c &&

OK.

> +	test_path_is_missing a.out &&
> +	test_path_is_missing src/part3.c &&

This is better than the original, which may have said "OK" upon
seeing a directory called "a.out".

> +	test_path_is_file docs/manual.txt &&
> +	test_path_is_file obj.o &&
> +	test_path_is_file build/lib.so &&

OK.

>  	git update-index --no-skip-worktree .gitignore &&
>  	git checkout .gitignore
>  '
> @@ -46,15 +46,15 @@ test_expect_success 'git clean' '
>  	mkdir -p build docs &&
>  	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
>  	git clean &&
> -	test -f Makefile &&
> -	test -f README &&
> -	test -f src/part1.c &&
> -	test -f src/part2.c &&
> -	test ! -f a.out &&
> -	test ! -f src/part3.c &&
> -	test -f docs/manual.txt &&
> -	test -f obj.o &&
> -	test -f build/lib.so
> +	test_path_is_file Makefile &&
> +	test_path_is_file README &&
> +	test_path_is_file src/part1.c &&
> +	test_path_is_file src/part2.c &&
> +	test_path_is_missing a.out &&
> +	test_path_is_missing src/part3.c &&
> +	test_path_is_file docs/manual.txt &&
> +	test_path_is_file obj.o &&
> +	test_path_is_file build/lib.so

The verbosity of this conversion makes me wonder if we want to have
"test_paths_are_files" and "test_paths_are_missing".  For that
matter, this test does not really care about the distinction between
files and directories (e.g. some tests said "test ! -d docs" and
would have passed if there were a 'docs' regular file, but what we
really care about is the path 'docs' is _gone_), so what we want may
be test_paths_exist and test_paths_are_missing.  With that, the
above hunk would become

	test_paths_exist Makefile README src/part1.c src/part2.c \
		obj.o build/lib.so &&
        test_paths_are_missing a.out src/part3.c

I dunno.

>  test_expect_success 'git clean -e' '
>  	rm -fr repo &&
>  	mkdir repo &&
> -	(
> -		cd repo &&
> -		git init &&
> -		touch known 1 2 3 &&
> -		git add known &&
> -		git clean -f -e 1 -e 2 &&
> -		test -e 1 &&
> -		test -e 2 &&
> -		! (test -e 3) &&
> -		test -e known
> -	)
> +	cd repo &&
> +	git init &&
> +	touch known 1 2 3 &&
> +	git add known &&
> +	git clean -f -e 1 -e 2 &&
> +	test_path_is_file 1 &&
> +	test_path_is_file 2 &&
> +	test_path_is_missing 3 &&
> +	test_path_is_file known
>  '

I think this is wrong.  The next test piece will be run inside
"repo" directory with this patch applied.  Don't lose the subshell
here.

  parent reply	other threads:[~2015-12-07 21:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26 14:44 [PATCH] clean: new option --exclude-from James
2015-11-30  2:24 ` Eric Sunshine
     [not found]   ` <CAGjXF72PgdjBw03ERVYxj+atvsBXK0LeJ6O3zTZgi3-kv9BWsw@mail.gmail.com>
2015-12-01 22:25     ` Eric Sunshine
2015-12-06 14:58       ` [PATCH v2 1/2] modernize t7300 James
2015-12-06 14:58         ` [PATCH v2 2/2] clean: new option --exclude-from James
2015-12-07 20:56           ` Jeff King
2015-12-07 21:44           ` Junio C Hamano
2015-12-07 22:53           ` Eric Sunshine
2015-12-07 21:40         ` Junio C Hamano [this message]
2015-12-07 22:46           ` [PATCH v2 1/2] modernize t7300 Eric Sunshine
2015-12-07 22:50             ` Junio C Hamano
2015-12-07 22:43         ` Eric Sunshine
2015-12-02  0:53 ` [PATCH] clean: new option --exclude-from Jeff King
2015-12-02  2:18   ` Junio C Hamano
2015-12-02  2:44     ` Jeff King
2015-12-02 16:40       ` Junio C Hamano
2015-12-02 16:47         ` Jeff King
2015-12-02 17:25           ` Junio C Hamano
2015-12-02 17:51             ` Jeff King
2015-12-06  3:51               ` Junio C Hamano
2015-12-07 19:39                 ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq610alyy5.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=rouzier@gmail.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).