Fork me on GitHub
#off-topic
<
2022-02-15
>
Stuart19:02:13

Anyone seen github do this ? You can't even have 2 folders on windows with the same name (even with different case, so this situation could never have arisen)

Stuart19:02:55

Some of the files are in sentilanDebugger on github, and some are in SentilanDebugger

Stuart19:02:21

WHen I look at the git changes, I have no pending changes at all.

hiredman19:02:53

look at git changes where?

hiredman19:02:07

you can get weird things like that when using repos on different filesystems that have different rules about that sort of thing

Stuart19:02:15

I'm on windows, I use git desktop to show my pending changes. It says I have none

hiredman19:02:30

what makes you think you should have some?

Stuart19:02:46

The different casing on the version on git

hiredman19:02:09

if the underlying filesystem is reporting the same directory for both cases, git can't tell the difference either

Stuart19:02:32

so is it likely if this was pulled on linux, there would indeed be 2 folders with the different case ?

p-himik19:02:45

If you need to use files with names in different cases, I'm pretty sure you should stick to a case-sensitive file system. NTFS, the default Windows file system, is not case sensitive by default but apparently you can put flags on separate directories. I would probably create a separate partition with a case-sensitive file system.

Stuart19:02:53

shit, then it would be broken on linux.

hiredman19:02:56

linux, or even windows on a different filesystem

Stuart19:02:08

How do I fix this if I'm on windows, I want git to have it all in the same folder with the proper casing

Stuart19:02:24

delete the folder, check it in, re-add, check it in?

hiredman19:02:32

that might do it, deleting the folder might show up as both folders being deleted in git

p-himik19:02:24

Or, figure out how to use that case-sensitive flag, enable it on all dirs within that local copy of the repo, do git status, and then git reset --hard.

hiredman19:02:31

there is surgery you could do on the repo using the git cli and manually creating tree objects and commits

Stuart19:02:55

OK, deleting removed both, and then readding got me back to one with the correct case. Bizzare, I've never dev'd on this repo (only created today) on anything other than my windows laptop. Dunno how this happened.

Stuart19:02:34

Unless maybe I had wrong case, checked it in, changed case and checked in again later and its picked up changes with a different folder name

hiredman19:02:35

some filesystems preserve case but are case insensitive

hiredman19:02:43

which can do that kind of thing

hiredman19:02:32

make it lowercase one place, uppercase somewhere else, on a case insensitive filesystem they look like the same folder, but once you move to a sensitive one you get both

hiredman19:02:05

"preserve case but are case insensitive" is such a terrible description, but they remember what case you used when creating a file and use that case when listing, etc, but will direct any file operations with a different case to the same file

dpsutton20:02:39

this type of thing has been a pain with tools-build coming from depstar. Jars are case sensitive but macosx is not. depstart would copy directly from the jar into the new jar. tools-build will explod all of the jars onto the (case-insensitive) osx filesystem. so things like LICENSE and license/mit.txt could not coexist

hiredman20:02:17

it bit a lot of people years ago when osx popularity really took off with devs that ended up deploying on linux servers

seancorfield20:02:30

If you're on Windows, use WSL2 and do your work there 🙂

👏 2
Martynas Maciulevičius20:02:05

Wouldn't WSL2 still run on the same NTFS? Or do they format separate partitions?

seancorfield20:02:27

It's a separate vfs.

seancorfield20:02:59

On my Windows laptop, using WSL2:

seanc@Sean-win-11-laptop:~$ mkdir example
seanc@Sean-win-11-laptop:~$ cd example/
seanc@Sean-win-11-laptop:~/example$ touch foo
seanc@Sean-win-11-laptop:~/example$ touch Foo
seanc@Sean-win-11-laptop:~/example$ touch FOO
seanc@Sean-win-11-laptop:~/example$ ls
FOO  Foo  foo

jaide21:02:07

Interestingly on OS X the default is also case-insensitive and switching to case sensitive breaks things, but I don't remember which apps specifically