Discussion:
[linux-elitists] More fun* with Git and make
Don Marti
2014-05-01 21:04:19 UTC
Permalink
Some of you showed up for this...
https://lwn.net/Articles/589196/

One more random idea. Instead of keeping track of
which files need to be ignored/cleaned up in _both_
.gitignore and the "clean" target in Makefile...

clean :
find . -print0 | \
git check-ignore -z --stdin | xargs -0 rm -f

DRY, right?
--
Don Marti
http://zgp.org/~dmarti/
***@zgp.org
Greg KH
2014-05-01 23:20:27 UTC
Permalink
Post by Don Marti
Some of you showed up for this...
https://lwn.net/Articles/589196/
One more random idea. Instead of keeping track of
which files need to be ignored/cleaned up in _both_
.gitignore and the "clean" target in Makefile...
find . -print0 | \
git check-ignore -z --stdin | xargs -0 rm -f
DRY, right?
Yes, but doesn't that "catch" your .git subtree containing your
metadata? It's not good to delete those files...

greg k-h
Don Marti
2014-05-02 05:29:52 UTC
Permalink
Post by Greg KH
Post by Don Marti
Some of you showed up for this...
https://lwn.net/Articles/589196/
One more random idea. Instead of keeping track of
which files need to be ignored/cleaned up in _both_
.gitignore and the "clean" target in Makefile...
find . -print0 | \
git check-ignore -z --stdin | xargs -0 rm -f
DRY, right?
Yes, but doesn't that "catch" your .git subtree containing your
metadata? It's not good to delete those files...
Good point. I can get it to do that by adding
.git/* to .gitignore which I haven't done before.
Probably safer...

clean :
find . -path ./.git -prune -o -print0 | \
git check-ignore -z --stdin | xargs -0 rm -f
--
Don Marti
http://zgp.org/~dmarti/
***@zgp.org
Continue reading on narkive:
Loading...