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

Re: Re* git clean --exclude broken?

From
Thomas Rast <trast@student.ethz.ch>
Date
Aug 26, 2011, 10:00 UTC
Message-ID
<201108261200.25792.trast@student.ethz.ch>
In-Reply-To
<7vpqjtl4yi.fsf_-_@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 13 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
> > The documentation and the implementation of "git clean" is quite confused.
> > ...
> 
> So here is a patch to fix the confusion.
> 
> It does not add a new "--except=C" I alluded to, but at least it should
> be the right first step to make the document clearly describe what the
> existing option does.
> 
> -- >8 --
> Subject: [PATCH] Documentation: clarify "git clean -e <pattern>"
It's not exclusively a doc patch, is it?
> +	if (ignored && exclude_list.nr)
> +		die(_("adding exclude with -e and ignoring it with -x is crazy"));

Please also add something like the following patch, so that 'git clean -h' does not confuse the user either.

diff --git i/builtin/clean.c w/builtin/clean.c
index 75697f7..33a3df9 100644
--- i/builtin/clean.c
+++ w/builtin/clean.c
@@ -54,7 +54,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
 		OPT_BOOLEAN('d', NULL, &remove_directories,
 				"remove whole directories"),
 		{ OPTION_CALLBACK, 'e', "exclude", &exclude_list, "pattern",
-		  "exclude <pattern>", PARSE_OPT_NONEG, exclude_cb },
+		  "add <pattern> to ignore rules", PARSE_OPT_NONEG, exclude_cb },
 		OPT_BOOLEAN('x', NULL, &ignored, "remove ignored files, too"),
 		OPT_BOOLEAN('X', NULL, &ignored_only,
 				"remove only ignored files"),
-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Junio C HamanoNext: Pete Wyckoff
Message 8 of 11 in “git clean --exclude broken?”
  1. Todd RinaldoAug 24, 2011
  2. Junio C HamanoAug 24, 2011
  3. Todd RinaldoAug 24, 2011
  4. Junio C HamanoAug 25, 2011
  5. Re* git clean --exclude broken?Junio C Hamano, Aug 25, 2011
  6. Michael SchubertAug 25, 2011
  7. Junio C HamanoAug 25, 2011
  8. Thomas RastAug 26, 2011
  9. Pete WyckoffAug 27, 2011
  10. Junio C HamanoAug 28, 2011
  11. Pete WyckoffAug 28, 2011

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.