Sygil-Dev / stable-diffusion

GNU Affero General Public License v3.0
1.72k stars 148 forks source link

.gitattributes: common template #91

Closed Lex-DRL closed 2 years ago

Lex-DRL commented 2 years ago

Template catching most of the file formats for a regular Python project which might get related to webdev in a future (python, OS scripts/configs, images, html, css, etc.) Almost all the text files are forced to be LF. The only exceptions are *.txt and purely windows formats (csharp, bat, cmd). Catches both lower- and uppercase extensions, with any mix of casing.

oc013 commented 2 years ago

Please note webui.py is synced from a different repository, so line endings should be updated there to make the changes stick. https://github.com/hlky/stable-diffusion-webui/

Lex-DRL commented 2 years ago

@oc013 , created: https://github.com/hlky/stable-diffusion-webui/pull/246

ChrisAcrobat commented 2 years ago

@Lex-DRL: Any reason for *.sh text eol=lf not being included? *.py text eol=lf was merged by mistake and I have no problem with it being excluded. EDIT: Oh, I see. * text=auto eol=lf defaults it to lf.

oc013 commented 2 years ago

@ChrisAcrobat Believe shell scripts would be covered by *.[Ss][Hh] diff=bash text eol=lf It's a small regex to cover upper and lowercase of the each letter

Lex-DRL commented 2 years ago

@oc013

It's a small regex

Unfortunately, it's not exactly a regex. https://en.wikipedia.org/wiki/Glob_(programming)

I personally hate glob syntax, but I guess it's a good middle ground between complexity and flexability. If it wasn't for glob limitations, I wouldn't have to do all that [Aa][Bb][Cc] nonsense.

hlky commented 2 years ago

image

not going to merge this, sorry, not an issue

oc013 commented 2 years ago

image https://github.com/hlky/stable-diffusion/pull/91/files?w=1

It is whitespace only changes. One way to fix PR #71

hlky commented 2 years ago

yes and its going to cause issues, it already has

hlky commented 2 years ago

i cant merge changes from dev without all the line endings changing meaning i cant easily revert anything in the future this has f*cked everything up imo, someone needs to revert the line ending changes on dev, im too annoyed with this fck up to do it

Lex-DRL commented 2 years ago

@hlky

yes and its going to cause issues, it already has

That's exactly the reason why .gitattributes with * text=auto eol=lf (with a trailing newline and a comment on a first line - without it, sometimes git interprets it weirdly due to BOM) should be committed at the very start of a repo. I usually do it right after an empty initial commit. Just a suggestion for your future work.

Anyway, thanks for your time and keep up the good work! Your GUI us AWESOME 👍🏻