Skip to content

added gitattributes to disable autocrlf, addressing issue #1234 #1238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 1, 2022

Conversation

aceslowman
Copy link
Contributor

Fixes/addresses #1234 (also #430)

Changes:

I've added a .gitattributes file that disables git autocrlf on the repository. On Windows, git will convert LF to CRLF on checkout, which breaks findName() in the build script. Hopefully this will make this problem less likely to come back up for those on Windows.

@takyano
Copy link
Contributor

takyano commented Jul 19, 2022

Should this be more focused and specify the file extensions that should be treated as text and binary?

* text eol=lf

might treat everything as text including png, jpeg and other binary files.

@Qianqianye Qianqianye requested a review from kjhollen July 19, 2022 19:03
@aceslowman
Copy link
Contributor Author

Should this be more focused and specify the file extensions that should be treated as text and binary?

* text eol=lf

might treat everything as text including png, jpeg and other binary files.

That makes sense, I just pushed a new commit, targeting only .js files in data/examples, will it need to be more specific than that?

@takyano
Copy link
Contributor

takyano commented Jul 20, 2022

What about any binary file formats like jpeg, gif, mov?

@aceslowman
Copy link
Contributor Author

What about any binary file formats like jpeg, gif, mov?

Wouldn't binary files be unaffected by this? From what I understand, git should be able to detect whether or not a file should be treated as binary, at least how I understand the discussion here.

@takyano
Copy link
Contributor

takyano commented Jul 20, 2022

I'd want to be more explicit and not leave anything to chance.

I might just paranoid. Give it a try and see if anything gets broken.

@aceslowman
Copy link
Contributor Author

I'd want to be more explicit and not leave anything to chance.

I might just paranoid. Give it a try and see if anything gets broken.

That's fair! Just updated the PR with a more explicit list of binary files.

@takyano
Copy link
Contributor

takyano commented Jul 20, 2022

I did a scan of the p5.js-website git repo and got the following file extensions, separated by text and binary.

You could just include the binary files. Mainly adding the ogg, ogv and font files, otf and ttf

Cascading Style Sheet

css text eol=lf

Comma Separated Value

csv text eol=lf

Embedded JavaScript template file

ejs text eol=lf

ESLint configuration file

eslintrc text eol=lf

WebGL Fragment Shader file

frag text eol=lf

Some file that deals with translations

ftl text eol=lf

Handlebars template system file

hbs text eol=lf

Hyper Text Markup Language file

html text eol=lf

JavaScript source file

js text eol=lf

JavaScript Object Notation file

json text eol=lf

CSS map

map text eol=lf

Narkdown markup file

md text eol=lf

3D modei file

obj text eol=lf

PHP source file

php text eol=lf

Scalable Vector Graphics image file

svg text eol=lf

Tom's Obvious, Minimal Language file

toml text eol=lf

Text file

txt text eol=lf

WebGL Vertex Shader file

vert text eol=lf

Extensible Markup Language file

xml text eol=lf

YAML Ain't Markup Language file

yml text eol=lf

Adobe Illustrator file format

ai binary

Graphics Interchange Format file

gif binary

Windows Icon Image file

ico binary

Joint Photgraphic Experts Group image file

jpg binary

QuickTime media file container

mov binary

MP3 audio file

mp3 binary

MP4 media file container

mp4 binary

OGG media file container

ogg binary

OGG video file container

ogv binary

OpenType font file

otf binary

Portable Document Format file

pdf binary

Portable Network Grpahics image file

png binary

Truetype font file

ttf binary

Waveform Audio File Format audio file

wav binary

WebM media file

webm binary

ZIP archive file

zip binary

@limzykenneth
Copy link
Member

@aceslowman For a final check locally, you can try to normalize using the rules you just set and see if there are any unexpected changes: https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#refreshing-a-repository-after-changing-line-endings

After that we can merge this. 😄

Copy link
Member

@kjhollen kjhollen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Built this on my mac and verified sketches on examples and reference pages still run. I don't have access to a Windows machine, but will take Austin's word for it!

@kjhollen kjhollen merged commit 0c4cd3e into processing:main Aug 1, 2022
@kjhollen
Copy link
Member

kjhollen commented Aug 1, 2022

@aceslowman can you try running the process that @limzykenneth suggested to check for errors? thanks! https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#refreshing-a-repository-after-changing-line-endings

(if I've merged too hastily let me know, and I can revert!)

@aceslowman
Copy link
Contributor Author

aceslowman commented Aug 1, 2022

@kjhollen @limzykenneth Just went through the process! It all works on my end, I ran watch at the end and can navigate all areas of the site. '--renormalize' did leave me with some modified files though, should those be pushed as well?

@kjhollen
Copy link
Member

kjhollen commented Aug 1, 2022

I think so—then they won't repeatedly show as modified for other contributors. Sounds like it's also a good opportunity to make sure that the remaining changed files are text files.

@aceslowman
Copy link
Contributor Author

aceslowman commented Aug 2, 2022

@kjhollen It appears that all of the files that were modified were text files, I've pushed a commit to the branch!

processing/p5.js-website@main...aceslowman:p5.js-website:gitattributesFix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants