this post was submitted on 24 Dec 2024
400 points (95.5% liked)

Programmer Humor

19821 readers
944 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] BatmanAoD@programming.dev 72 points 1 day ago (24 children)

I honestly don't even understand the joke. Case-insensitive file names cause problems, but what does that have to do with version control branch names?

[–] jeansburger@lemmy.world 111 points 1 day ago (23 children)

Inside git's internal plumbing folder, git holds a file with the branch name and all of the references (files and changes) for that branch.

When you make a new branch git will update its internal plumbing checking to see if the new branch already exists, updates its references to the new branch if it doesn't (all held internally in a case sensitive way). It will then make that new branch file, git has already checked that the case senitive name for the branch doesn't exist internally, so it should be good to go.

Part of its process is creating that internal branch file... But wait!

Windows doesn't have case sensitive naming so when it tries to make that new branch file it will overwrite the old one (since it shouldn't exist by git's own reference!) All of the files and references for it now get nuked.

Now you're at best back to wherever that originally named branch came from, at worse your .git folder is properly borked.

[–] dohpaz42@lemmy.world 63 points 1 day ago (21 children)

I’m probably going to get downvoted to Hell and back, but someone’s gotta say it: that’s a git problem, not Windows.

First of all, I agree that case-insensitive file systems suck. It makes things inconsistent, especially from a development standpoint.

But, everyone has known that Windows (and macOS) use case insensitive file systems. At least for Windows, it always has been that way.

Git was written in Linux, which uses a case sensitive file system. So it’s no surprise that its internals use case insensitive storage. Someone ported it over to Windows, and I’m sure they knew about the file system differences. They could’ve taken that into account for file systems that are case insensitive, but chose not to do anything to safe guard Windows users.

But until the day that somebody fixes Git, everybody who is not using case sensitive file systems needs to care more about how they name things (and make sure their team does too). Because fuck everyone else, right?

[–] octade@soc.octade.net 6 points 1 day ago

@jeansburger@lemmy.world

"I’m probably going to get downvoted to Hell and back, but someone’s gotta say it: that’s a git problem, not Windows."

Beware neckbeards with pitchforks.

load more comments (20 replies)
load more comments (21 replies)
load more comments (21 replies)