git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Cameron Boehmer <cameron.boehmer@gmail.com>
To: gitster@pobox.com
Cc: rsbecker@nexbridge.com, avarab@gmail.com, git@vger.kernel.org
Subject: Re: [RFC] git clean --local
Date: Sun, 2 Dec 2018 23:40:56 -0800	[thread overview]
Message-ID: <CAM+q9MfiycW6kXRLHsseKp+n1k9goALjRY-ePke2vYDhqcpD=g@mail.gmail.com> (raw)
In-Reply-To: <xmqqk1kriuu8.fsf@gitster-ct.c.googlers.com>

> > Would something like git clean --exclude=file-pattern work as a
> > compromise notion? Files matching the pattern would not be cleaned
> > regardless of .gitignore or their potential preciousness status
> > long-term. Multiple repetitions of the --exclude option might be
> > supportable. I could see that being somewhat useful in scripting.
>
> I think "git clean" already takes "-e", but I am not sure if it is
> meant to do what you wrote above.

It does already take --exclude=file-pattern, which is like adding
lines to .gitignore. (W/o -x/-X, that would mean DON'T clean them, but
with -x/-X, it means DO clean them.)

>
> If "git clean" takes a pathspec, perhaps you can give a negative
> pathspec to exclude whatever you do not want to get cleaned,
> something like
>
>         git clean '*.o' ':!precious.o'
>

I like this, but I'm also 100% satisfied with Junio's previous suggestion:
    git -c core.excludesFile=/dev/null clean ...

  reply	other threads:[~2018-12-03  7:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-01 22:51 [RFC] git clean --local Cameron Boehmer
2018-12-02  0:04 ` Junio C Hamano
2018-12-02  4:43   ` Junio C Hamano
2018-12-02 13:25 ` Ævar Arnfjörð Bjarmason
2018-12-02 17:37   ` Randall S. Becker
2018-12-02 19:37     ` Junio C Hamano
2018-12-03  7:40       ` Cameron Boehmer [this message]
2018-12-04  2:45       ` Junio C Hamano

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='CAM+q9MfiycW6kXRLHsseKp+n1k9goALjRY-ePke2vYDhqcpD=g@mail.gmail.com' \
    --to=cameron.boehmer@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=rsbecker@nexbridge.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).