{"thread":{"id":"8046","subject":"Perl code for git-clean","startedAt":"2007-05-08T23:51:55Z","lastAt":"2007-05-08T23:51:55Z","messageCount":1,"participants":["Randal L. Schwartz"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"41515","messageId":"86hcqm98mc.fsf@blue.stonehenge.com","threadId":"8046","inReplyTo":null,"subject":"Perl code for git-clean","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2007-05-08T23:51:55Z","receivedAt":"2007-05-08T23:51:55Z","isPatch":false,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":"\nOK, this is untested, but I usually get this stuff right\nby eyeballing it. :)\n\nexport cleandir;\ngit-ls-files -z --others --directory $excl ${excl_info:+\"$excl_info\"} -- \"$@\" |\nperl -ln0e '\n  use File::Path qw(rmtree);\n  if (-d and not -L) {\n    if (not $ENV{cleandir}) {\n      print \"Not removing $_\";\n      next;\n    }\n    print \"Removing $_\";\n    rmtree($_);\n  } else {\n    print \"Removing $_\";\n    unlink($_);\n  }\n'\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nPerl/Unix/security consulting, Technical writing, Comedy, etc. etc.\nSee PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!\n"}]}