git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] Add test for git clean -e.

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 20, 2010, 20:34 UTC
Message-ID
<7vmxtllwoi.fsf@alter.siamese.dyndns.org>
In-Reply-To
<b8f95cd841124e24b9774c301ac63e803da325de.1279654370.git.jaredhance@gmail.com>
Jared Hance <jaredhance@gmail.com> writes:
Show 28 quoted lines
> 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?
Previous: Jared HanceNext: Jared Hance
Message 5 of 7 in “Add -e/--exclude to git-clean.”
  1. 0/2 Add -e/--exclude to git-clean.Jared Hance, Jul 20, 2010
  2. 1/2 Add -e/--exclude to git-clean.Jared Hance, Jul 20, 2010
  3. Junio C HamanoJul 20, 2010
  4. 2/2 Add test for git clean -e.Jared Hance, Jul 20, 2010
  5. Junio C HamanoJul 20, 2010
  6. Jared HanceJul 20, 2010
  7. Jared HanceJul 20, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.