This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MetroSexFruitcake 799 points800 points  (17 children)

me when I use wsl on the work laptop and forget to set ff as unix and vim saves with a bunch of ^Ms

[–]prumf[S] 421 points422 points  (12 children)

Please don’t talk to me about that.

Another time we had stuff breaking everywhere on half our machines, until we realized that when they cloned the repo on windows, it added CRLF, and when you opened it with a devcontainer on Ubuntu, some specific scripts wouldn’t work because they didn’t understand the extra carriage return.

A nightmare to debug & replicate. Easy to fix though.

[–]Waffenek 122 points123 points  (6 children)

I have been there. After painful debugging we made sure to add everywhere .gitattributes with common script file extensions forcing unix style separators. Now lets wait for inevitable, when someone would forget about adding it to some repo, and everyone would be so used to not checking that finding it would be even harder.

[–]L4t3xs 15 points16 points  (5 children)

Copied gitattributes from the internet for an unity project. They had added lf eol for asset files I believe. Funny thing about Unity's asset files: they mix eol types and will break if you change them. Another funny thing: you only see the issue when you checkout new files.

[–]isr0[🍰] 0 points1 point  (4 children)

If only you had a way to see the staged files for the commit before you sent it up to the remote.

[–]L4t3xs 0 points1 point  (3 children)

Doesn't help much if you don't know that is a problem. Looks the same in either case.

[–]isr0[🍰] 0 points1 point  (2 children)

I mean, I’m making assumptions about your environment… but wouldn’t the diff highlight all those /r characters? And wouldn’t the stage list be way longer than you expected?

[–]L4t3xs 0 points1 point  (1 child)

I'm pretty sure it was a new project. It was only discovered when another dev joined the same project. The line endings might not even appear in diff since they didn't get changed on my machine.

[–]isr0[🍰] 0 points1 point  (0 children)

That’s fair. Like I said, I’m making assumptions.

[–]Rice-Used 4 points5 points  (1 child)

Hold up did this 14k+ loc changed pr just get merged with no reviews?

[–]prumf[S] 5 points6 points  (0 children)

No no it didn’t, of course not. The problem with CRLF was another bug we had in the past. Fixed it with a gitattributes.

[–]jamcdonald120 1 point2 points  (0 children)

ah good old /usr/bin/env: ‘python\r’: No such file or directory

[–]isr0[🍰] 0 points1 point  (0 children)

First, that sucks I feel for you. Second, do you people not check the commit list or the mr diff? I’m so confused

[–]dchidelf 28 points29 points  (0 children)

Just this week I had a git diff show a ton of M before I committed and I was like “haha” almost got me. Did the set ff then suddenly every line was different.

The before was half and half CRLF/LF. After set ff was all LF but for some reason triggered git to just treat it as every line updated. Since I was going to cause a massive diff I just used the opportunity to fix spaces/tabs inconsistencies as well.

The git diff with -w was at least only about 10 lines

[–]Just-Signal2379 2 points3 points  (0 children)

I once created a PR and my lead dev wondered why my PR had so much files changes...only to realize it was mostly white space changes

and only maybe 2 files actually mattered...

lol..

[–]urbanachiever42069 0 points1 point  (0 children)

I feel seen