public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Jared Hance <jaredhance@gmail•com>
Cc: git@vger•kernel.org
Subject: Re: [PATCH 2/2] Add test for git clean -e.
Date: Tue, 20 Jul 2010 13:34:21 -0700	[thread overview]
Message-ID: <7vmxtllwoi.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <b8f95cd841124e24b9774c301ac63e803da325de.1279654370.git.jaredhance@gmail.com> (Jared Hance's message of "Tue\, 20 Jul 2010 15\:36\:21 -0400")

Jared Hance <jaredhance@gmail•com> writes:

> Signed-off-by: Jared Hance <jaredhance@gmail•com>
> ---
>  t/t7300-clean.sh |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
> index 7d8ed68..3a43571 100755
> --- a/t/t7300-clean.sh
> +++ b/t/t7300-clean.sh
> @@ -438,4 +438,20 @@ test_expect_success 'force removal of nested git work tree' '
>  	! test -d bar
>  '
>  
> +test_expect_success 'git clean -e' '
> +	rm -fr repo &&
> +	mkdir repo &&
> +	(
> +		cd repo &&
> +		git init &&
> +		touch 1 2 3 known &&
> +		git add known &&
> +		git clean -f -e 1 -e 2 &&
> +		test -e 1 &&
> +		test -e 2 &&
> +		! (test -e 3) &&
> +		test -e known
> +	)
> +'

This is a good start but it doesn't seem to test possible interactions
with entries in .gitignore file(s) in the working tree.  Do we care?

What should happen when a path "path":

 (1) is marked to be ignored in .gitignore and -e "path" is also given;

 (2) is marked not to be ignored (i.e. "!path") in .gitignore but -e
    "path" is given;

 (3) is marked to be ignored in .gitignore but -e "!path" is given;

 (4) is marked not to be ignored in .gitignore and -e "!path" is also
     given;

 (5) perhaps other combinations like "!path" in a/.gitignore, and -e "a/path"
     from the command line.

What does the code actually do?

  reply	other threads:[~2010-07-20 20:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-20 19:35 [PATCH 0/2] Add -e/--exclude to git-clean Jared Hance
2010-07-20 19:35 ` [PATCH 1/2] " Jared Hance
2010-07-20 20:27   ` Junio C Hamano
2010-07-20 19:36 ` [PATCH 2/2] Add test for git clean -e Jared Hance
2010-07-20 20:34   ` Junio C Hamano [this message]
2010-07-20 23:35     ` Jared Hance
2010-07-20 19:43 ` [PATCH 0/2] Add -e/--exclude to git-clean Jared Hance
  -- strict thread matches above, loose matches on Subject: below --
2010-07-19 18:39 [PATCH v3] Add --exclude " Jared Hance
2010-07-20 16:28 ` [PATCH/RFC v4 0/2] Add -e/--exclude to git clean Jared Hance
2010-07-20 16:30   ` [PATCH 2/2] Add test for git clean -e Jared Hance

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

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

  git send-email \
    --in-reply-to=7vmxtllwoi.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=jaredhance@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox