From: merlyn@stonehenge•com (Randal L. Schwartz)
To: git@vger•kernel.org
Subject: Perl code for git-clean
Date: Tue, 08 May 2007 16:51:55 -0700 [thread overview]
Message-ID: <86hcqm98mc.fsf@blue.stonehenge.com> (raw)
OK, this is untested, but I usually get this stuff right
by eyeballing it. :)
export cleandir;
git-ls-files -z --others --directory $excl ${excl_info:+"$excl_info"} -- "$@" |
perl -ln0e '
use File::Path qw(rmtree);
if (-d and not -L) {
if (not $ENV{cleandir}) {
print "Not removing $_";
next;
}
print "Removing $_";
rmtree($_);
} else {
print "Removing $_";
unlink($_);
}
'
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge•com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
reply other threads:[~2007-05-08 23:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=86hcqm98mc.fsf@blue.stonehenge.com \
--to=merlyn@stonehenge$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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