r/ProgrammerHumor • • 7d ago • Bravo 1

Meme stopDoingGitHubDesktop

Post image
1.6k Upvotes

390 comments sorted by

View all comments

5

u/DJDevon3 7d ago

I wrote a power shell script specifically just to change CRLF to LF line endings that github windows app automatically adds to every commit. They created an entire windows app for Github but couldn't bother to allow an option to keep LF line ending formatting only for contributing to linux based file systems. I run WSL so switching back and forth was causing a windows/linux dev environment issue that drove me insane.

22

u/nickcash 7d ago

can't you do this with gitattributes?

11

u/99percentcheese 7d ago

you can

2

u/Werftflammen 7d ago

Looking at this thread as a sysadmin I wonder how anything even functions. Layer 7 is malaria territory.

1

u/DJDevon3 1d ago

It only works for the first session then ignores your attributes. That was a deeper part of the problem.

I'm quoting myself from April 2024.

There are workarounds published online that include changing an environment variable and global git config. That workaround only works for 1 session, as soon as you close Github Desktop it will promptly ignore your previous changes. There are hundreds of issues filed about this in the Github Desktop repo over the past decade with no real solution.

My published article on Adafruit about the issue. I was contributing to Adafruit at the time who required Pylint, pre-commit, black, reuse, and other custom linting scripts. If you didn't pass the linting check you couldn't commit and that included using LF line endings otherwise Pylint & Black would throw thousands or tens of thousands of errors.

13

u/Goldman7911 7d ago
$ git config --global core.autocrlf true
# Configure Git to ensure line endings in files you checkout are correct for Windows.
# For compatibility, line endings are converted to Unix style when you commit files.

3

u/DOOManiac 7d ago

I was gonna say, this is already built in to Git.

5

u/MornwindShoma 7d ago

My guy, just use the Git implementation in your IDE...

Even doing PRs is better in your IDE than touching Github.

2

u/DJDevon3 1d ago

I agree but I liked having the IDE separate for reasons that are harder to explain. I found Github desktop easier to use. The downside is far less control. There are some things you simply cannot do with Github desktop.

My preferred IDE is actually Mu or Notepad++ and Git integration is either non-existent or severly lacking with lightweight IDE's. Because I was coding for micro-controllers I found PyCharm and other IDE's inefficient for fast work. I tried many different IDE's. Without going into the nuance of connecting via serial or web serial I'll just say that the smaller IDE's work better for that environment. For main C Python, completely different story, PyCharm works great with Git for Python. It's because of the micro-controller architectures and connecting (more importantly holding that connection) that changes the equation for what I believe was the most efficient workflow for me.

1

u/MornwindShoma 1d ago

Makes sense. Personally I do use a mix of editors and still rely on Sublime Merge from time to time as well - but I wouldn't use Github Desktop anyway