FHIR Chat · clean.sh · committers

Stream: committers

Topic: clean.sh


view this post on Zulip Grahame Grieve (Sep 07 2018 at 03:00):

http://community.fhir.org/t/i-just-reported-your-script-deleting-my-home-directory-as-malware-to-github/953

view this post on Zulip Grahame Grieve (Sep 07 2018 at 03:00):

umm.. think that's a little over the top. Not sure what to do with it?

view this post on Zulip Grahame Grieve (Sep 07 2018 at 03:01):

the windows batch file is not so dangerous

view this post on Zulip Josh Mandel (Sep 07 2018 at 03:09):

This script shouldn't exist. it should be replaced by "git clean" as a first pass.

view this post on Zulip Josh Mandel (Sep 07 2018 at 03:09):

It does look incredibly dangerous.

view this post on Zulip Grahame Grieve (Sep 07 2018 at 03:29):

git clean is not the same thing

view this post on Zulip Josh Mandel (Sep 07 2018 at 03:39):

What's the specific use case?

view this post on Zulip Josh Mandel (Sep 07 2018 at 03:39):

(if nothing else, the sh script should work more like the .bat)

view this post on Zulip Grahame Grieve (Sep 07 2018 at 03:40):

clean.ba/sh deletes all the output files, and the stupid backup files that get created all over the places (e.g. clutter text search) without deleting source files

view this post on Zulip Grahame Grieve (Sep 07 2018 at 03:40):

I didn't write the .sh file, or it would work like the bat file

view this post on Zulip Grahame Grieve (Sep 07 2018 at 03:40):

git clean would delete candidate sources files as well.

view this post on Zulip Josh Mandel (Sep 07 2018 at 03:45):

This reminds me that backup files should be added to a .gitignore -- do we have a list of extensions that shouldn't be checked in?

view this post on Zulip Josh Mandel (Sep 07 2018 at 03:45):

.bak, .class, .tmp, .jar ...

view this post on Zulip Josh Mandel (Sep 07 2018 at 03:46):

If we get that right, then "git clean -X" may do the trick of clean.sh

view this post on Zulip Grahame Grieve (Sep 07 2018 at 03:48):

gie clean "removes all untracked files, including build products" - obviously i was not clear enough about the difference. We *do not want to remove all untracked files"

view this post on Zulip Grahame Grieve (Sep 07 2018 at 03:48):

here's my svn ignore list

view this post on Zulip Grahame Grieve (Sep 07 2018 at 03:48):

fhir-error-dump.txt
source-lloyd
publish.zip
*.gitattributes
ivy
publish-web.bat
fhir-error-dump.html
validation.log
local.ini
13005_patch
*.gen.svg

view this post on Zulip Grahame Grieve (Sep 07 2018 at 03:48):

weird things in there

view this post on Zulip Josh Mandel (Sep 07 2018 at 03:48):

-X ensures that it only removes ignored files though

view this post on Zulip Grahame Grieve (Sep 07 2018 at 03:49):

oh. well that might do it then

view this post on Zulip Grahame Grieve (Sep 07 2018 at 03:50):

my ignore list would actually be:
*.bak
*.class
*.~ *
publish
temp

view this post on Zulip Grahame Grieve (Sep 07 2018 at 03:51):

extra space after ~ in order to get the * to show - but not in actual file filter

view this post on Zulip Josh Mandel (Sep 07 2018 at 03:51):

Cool.

view this post on Zulip Grahame Grieve (Sep 07 2018 at 03:51):

but tell me why git clean -X is less dangerous?

view this post on Zulip Grahame Grieve (Sep 07 2018 at 03:52):

I guess it limits to those file types and locations...

view this post on Zulip Grahame Grieve (Sep 07 2018 at 03:53):

but what if you run it in the wrong directory (as is evidently what happened here)

view this post on Zulip Josh Mandel (Sep 07 2018 at 03:53):

Because it can't delete your home dir. (If some of the named directories in clean.sh are missing, then cd ../../.. could point to something very high in the root hierarchy and then delete all files.)

view this post on Zulip Grahame Grieve (Sep 07 2018 at 03:54):

well, ok, if you say so

view this post on Zulip Grahame Grieve (Sep 08 2018 at 02:19):

so we're just going to delete clean.sh?

view this post on Zulip Lloyd McKenzie (Sep 11 2018 at 03:17):

No objections raised, so I guess delete it. (Or replace it with a call to git clean -X)


Last updated: Apr 12 2022 at 19:14 UTC