Re: [RFC] git clean --local

2 messages, 2 authors, 2018-12-03 · open the first message on its own page

Re: [RFC] git clean --local

From: Junio C Hamano <hidden>
Date: 2018-12-02 19:37:11

"Randall S. Becker" [off-list ref] writes:

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.

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'

to say "presious.o is ignored (hence normally expendable), but I do
not want to clean it with this invocation of 'git clean'"?

Re: [RFC] git clean --local

From: Cameron Boehmer <hidden>
Date: 2018-12-03 07:41:11

quoted
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 ...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help