From: Junio C Hamano <gitster@pobox.com>
To: Pete Wyckoff <pw@padd.com>
Cc: git@vger.kernel.org, Todd Rinaldo <toddr@cpanel.net>
Subject: Re: Re* git clean --exclude broken?
Date: Sat, 27 Aug 2011 23:27:38 -0700 [thread overview]
Message-ID: <7v62li9hk5.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20110827235458.GA8124@arf.padd.com> (Pete Wyckoff's message of "Sat, 27 Aug 2011 19:54:58 -0400")
Pete Wyckoff <pw@padd.com> writes:
>> diff --git a/Documentation/git-clean.txt b/Documentation/git-clean.txt
>> index 974e04e..a7a18e3 100644
>> --- a/Documentation/git-clean.txt
>> +++ b/Documentation/git-clean.txt
>> @@ -47,9 +47,9 @@ OPTIONS
>>
>> -e <pattern>::
>> --exclude=<pattern>::
>> - Specify special exceptions to not be cleaned. Each <pattern> is
>> - the same form as in $GIT_DIR/info/excludes and this option can be
>> - given multiple times.
>> + In addition to what are found in .gitignore (per directory) and
>> + $GIT_DIR/info/exclude, also consider these patterns to be in the
>> + set of the ignore rules in effect.
>>
>> -x::
>> Don't use the ignore rules. This allows removing all untracked
>> diff --git a/builtin/clean.c b/builtin/clean.c
>> index 75697f7..3782718 100644
>> --- a/builtin/clean.c
>> +++ b/builtin/clean.c
>> @@ -76,6 +76,8 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
>>
>> if (ignored && ignored_only)
>> die(_("-x and -X cannot be used together"));
>> + if (ignored && exclude_list.nr)
>> + die(_("adding exclude with -e and ignoring it with -x is crazy"));
>
> This breaks one of my use cases for git clean.
The description of '-x' needs to be also updated to reflect what it does.
How about this on top?
Documentation/git-clean.txt | 4 +++-
builtin/clean.c | 2 --
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-clean.txt b/Documentation/git-clean.txt
index b49674f..79fb984 100644
--- a/Documentation/git-clean.txt
+++ b/Documentation/git-clean.txt
@@ -52,7 +52,9 @@ OPTIONS
set of the ignore rules in effect.
-x::
- Don't use the ignore rules. This allows removing all untracked
+ Don't use the standard ignore rules read from .gitignore (per
+ directory) and $GIT_DIR/info/exclude, but do still use the ignore
+ rules given with `-e` options. This allows removing all untracked
files, including build products. This can be used (possibly in
conjunction with 'git reset') to create a pristine
working directory to test a clean build.
diff --git a/builtin/clean.c b/builtin/clean.c
index 7fcbf87..0c7b3d0 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -76,8 +76,6 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
if (ignored && ignored_only)
die(_("-x and -X cannot be used together"));
- if (ignored && exclude_list.nr)
- die(_("adding exclude with -e and ignoring it with -x is crazy"));
if (!show_only && !force) {
if (config_set)
next prev parent reply other threads:[~2011-08-28 6:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-24 19:15 git clean --exclude broken? Todd Rinaldo
2011-08-24 21:23 ` Junio C Hamano
2011-08-24 23:08 ` Todd Rinaldo
2011-08-25 1:38 ` Junio C Hamano
2011-08-25 18:29 ` Re* " Junio C Hamano
2011-08-25 18:38 ` Michael Schubert
2011-08-25 20:28 ` Junio C Hamano
2011-08-26 10:00 ` Thomas Rast
2011-08-27 23:54 ` Pete Wyckoff
2011-08-28 6:27 ` Junio C Hamano [this message]
2011-08-28 12:31 ` Pete Wyckoff
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=7v62li9hk5.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=pw@padd.com \
--cc=toddr@cpanel.net \
/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.
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 NNTP newsgroup(s).