git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2 2/2] attr: more matching optimizations from .gitignore
Date: Fri, 12 Oct 2012 12:09:57 -0700	[thread overview]
Message-ID: <7vy5jb33sq.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1349864466-28289-1-git-send-email-pclouds@gmail.com> ("Nguyễn	Thái Ngọc Duy"'s message of "Wed, 10 Oct 2012 17:21:06 +0700")

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh
> index 51f3045..4a1402f 100755
> --- a/t/t0003-attributes.sh
> +++ b/t/t0003-attributes.sh
> @@ -242,4 +242,18 @@ test_expect_success 'bare repository: test info/attributes' '
>  	attr_check subdir/a/i unspecified
>  '
>  
> +test_expect_success 'leave bare' '
> +	cd ..
> +'
> +
> +test_expect_success 'negative patterns' '
> +	echo "!f test=bar" >.gitattributes &&
> +	test_must_fail git check-attr test -- f
> +'
> +
> +test_expect_success 'patterns starting with exclamation' '
> +	echo "\!f test=foo" >.gitattributes &&
> +	attr_check "!f" foo
> +'
> +
>  test_done

This is not entirely your fault, but please don't do that "cd ..".

The original test had "cd bare", made an assumption that step will
never fail (which is mostly correct), and ran everything afterward
in that subdirectory.

Adding "Do a 'cd ..' to come back" is a horrible way to build on
it.  Imagine what happens when another person also did the same
thing, and both changes need to be merged.  You will end up going up
two levels, which is not what you want.

I think the right fix is to make each of the test that wants to run
in "bare" chdir in its own subshell, or not append these new tests
that do not run in the "bare" to the end of this file, but before
the execution goes down to "bare".

  parent reply	other threads:[~2012-10-12 19:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-09  2:24 [PATCH nd/attr-match-optim-more 1/2] gitignore: make pattern parsing code a separate function Nguyễn Thái Ngọc Duy
2012-10-09  2:24 ` [PATCH nd/attr-match-optim-more 2/2] attr: more matching optimizations from .gitignore Nguyễn Thái Ngọc Duy
2012-10-09  5:08   ` Junio C Hamano
2012-10-09  6:10     ` Johannes Sixt
2012-10-09  6:47       ` Junio C Hamano
2012-10-09 16:40         ` Junio C Hamano
2012-10-10 10:21     ` [PATCH v2 " Nguyễn Thái Ngọc Duy
2012-10-10 20:03       ` Junio C Hamano
2012-10-12 10:13         ` Nguyen Thai Ngoc Duy
2012-10-10 21:41       ` Junio C Hamano
2012-10-10 21:50         ` Junio C Hamano
2012-10-11  1:36         ` Nguyen Thai Ngoc Duy
2012-10-12 19:09       ` Junio C Hamano [this message]
2012-10-13  4:32         ` Nguyen Thai Ngoc Duy

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=7vy5jb33sq.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.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).