mastodon.ar.al is one of the many independent Mastodon servers you can use to participate in the fediverse.
This is my personal fediverse server.

Administered by:

Server stats:

1
active users

Aral Balkan

Protip: On Linux, if you rename a file, changing only the case of the file name somehow, e.g.,

main.layout.js → Main.layout.js,

Git will pick up the change immediately.

On macOS, because it Just Works™ and you’re holding it wrong, you have to manually tell it:

git mv main.layout.js Main.layout.js

🤷‍♂️

@aral Making two files the same name with different cased letters used to be a preferred method of Linux users trolling Windows users.

@aral Also, Linux not respecting file extensions as a magical thing was definitely weird for me on day 1 of Linux. "You mean renaming it to exe or com doesn't make it executable?! What the heck it chmod?"

And sometimes the extension lies, which is why the `file` command is awesome.

@vwbusguy @aral didn’t know about the file command, thanks!

@vwbusguy @aral in my sordid youth I discovered you could use low-level CP/M calls to assign files “impossible” names, and thus make them visible to & accessible only to those using low-level BDOS calls.

@aral I could be wrong but I think that may depend on your system volume format. I ran into this a couple years ago and realized there is a case-sensitive APFS option which is not used by default. I’d be curious if that changes the behaviour.

@greatislander Yeah, this is just the default behaviour.

@greatislander @aral I enabled this on a MacBook I had and it was not a lovely experience. Some pretty high profile stuff like Creative Cloud would just not work at all.

@aral I remember the fun days with Subversion, where the repo was shared by both Linux and Windows users…

@aral Unless you have your filesystem in case-sensitive mode (which also makes it so you can't install most Adobe Software, ask me how I know).

But I didn't know about `git mv` -- that is very useful!

@hn3000 @aral Hah didn't see this before I replied to someone else but it's good to know there are more people out there that have been through this pain.

@aral hmmm, theoretically I *think* you want “APFS (Case-sensitive, Encrypted)” (for 10.13 and later) or “Mac OS Extended (Case-sensitive, Journaled, Encrypted)” for 10.12 and earlier to get that.

for details & choices see also: support.apple.com/guide/disk-u

Apple SupportFile system formats available in Disk Utility on MacIn Disk Utility on your Mac, format disks or volumes using Apple File System (APFS), Mac OS Extended, MS-DOS (FAT), and ExFAT.

@aral okay, confirmed...

I mounted a drive I knew was *not* formatted as per Apple default, but instead as Case-sensitive, and here are the test results:

@aral Some parts of git-on-osx experience feel like decisions made out of sheer spite for non-linux users. Like insisting on mac-style argument order (flags before positional arguments, not after) even though it’s more flexible on linux and a lot of other tools somehow manage to be more flexible on macos, too.

@marcink @aral Considering how some people I personally know that use macOS as their main programming OS tended to be treated when they submitted bug reports, I got the hint that it's an intentional design choice

@aral macOS is not case sensitive, it only appears to be

@aral same with coding in R: having capitalisation errors while using source() do not matter in osx, it does on a linux machine.

I learned the hard way...

@aral you can use git config core.ignorecase false to always have git on Mac OS pick up the changes. Hope it helps :)

@aral If you are working with git on a Mac, sharing repos with other platforms, your life will be far better if you make yourself a case sensitive sparsebundle and work in that. coderwall.com/p/mgi8ja/case-se & stackoverflow.com/a/12085233/1 has made my life easier for a decade without worrying about autcrlf or safecrlf.

Exclude it from Time Machine backups too because what's the point of backing up a git repo & build artifacts if you push to a remote regularly? (1/2)

CoderwallCase-sensitive git in Mac OS X like a Pro (Example)A protip by grevenx about osx, rename, filename, git, and case-sensitivity.
@aral The kernel, Linux usually doesn't even comprehend what case is - each filesystem driver implements a data structure for each file that includes a a field for the "file name" (filesystem drivers don't even need to be a Linux driver, they can be a FUSE driver that doesn't really care about what kernel you use a long as it can access a certain interface).

If you run mv main.layout.js --> Main.layout.js, GNU mv will call rename("path/to/main.layout.js", "path/to/Main.layout.js"), which will instruct glibc to call the correct SYSCALL to Linux or to Hurd.

git on running `git commit` will run the appropriate lstat(), openndir() and readdir() glibc commands and compare the current filesystem layout to its internal data structure of the last commit.

macOS's libc also happens to implement similar functions, except those functions are so broken it's not possible to do a case-sensitive match

As always, that should have been; "On GNU/Linux, if you rename a file" or; "On LiGNUx if you rename a file" or to refer to both GNU/Linux and GNU/Hurd (both have the same behavior) in a shorter to type way; "On GNU, if you rename a file".


Computers are case sensitive (although the option for a case-insensitive *search* has its usages) and so no matter what you try, "case insensitive filesystems" always end up case sensitive in corner cases.

>Linux must have to examine file structure to estimate file type
Linux has no concept of file structures - for every file contents, all it sees is a block of bytes.

The `file` command, which has nothing to do with Linux, uses magic definitions in /usr/share/misc/magic /usr/share/misc/magic.mgc to guess filetypes, which is very reliable for files that use magic headers.

Some software written for GNU does use file extensions like .conf to mark configuration files, but determining that a `.conf` extensioned files is actually a configuration file is an act of parsing.

@aral only if you’ve selected a case-insensitive file system?

@holdenweb It’s a Mac; for 99.99999% of people, Apple selects it for you.