Skip to contentSkip to conversation

windows git problem

DISCUSSION luis 3 participants 5 messages Jun 15, 2016

lore
Share & tools
lore

luis

author
#0 lore raw

Hi Guys,

I recently run into a funny git situation.

I had a directory under git control named "someName", with a bunch of files inside. This was committed and working for some time. I then added a file name "somename", and under linux, that worked OK.
However when I checked out the project under windows (either clone or pull) one or the other would disappear and it would be staged as removed.

The surprising bit for me was not so much that windows could not cope with the case sensitivity, but that git would stage the changes!

I have attached a new git project with the problem that should help show the issue. If you clone from this repo on a windows box you should be able to see it

BTW, I'm using git v 1.7.4.1

Signature · 3 lines
Luis Gutierrez
Test and Verification Solutions (TVS)
skype: luis.tandv
#1 lore raw
Quoted 5 lines · luis

However when I checked out the project under windows (either clone or pull) one or the other would disappear and it would be staged as removed.

The surprising bit for me was not so much that windows could not cope with the case sensitivity, but that git would stage the changes!

It would be recorded in the index as a change ready to be committed (as though `git rm' had been used)?

author
#2 lore raw

Exactly!

so the next time someone (in windows) does a commit, they remove the file or the folder contents!

Quoted 9 lines · Michael Witten
Quoted 5 lines · luis

However when I checked out the project under windows (either clone or pull) one or the other would disappear and it would be staged as removed.

The surprising bit for me was not so much that windows could not cope with the case sensitivity, but that git would stage the changes!

It would be recorded in the index as a change ready to be committed (as though `git rm' had been used)?

Signature · 3 lines
Luis Gutierrez
Test and Verification Solutions (TVS)
skype: luis.tandv
#3 lore raw
Quoted 4 lines · luis

Exactly!

so the next time someone (in windows) does a commit, they remove the file or the folder contents!

May be this commit dc1ae70 (Support case folding for git add when core.ignorecase=true). Forcing core.ignorecase to add_to_index() seems a bit too strong for me. We could have added a new flag, ADD_CASE_INSENSITIVE, to add_to_index() and enabled it only to selected commands instead.

Or maybe we can improve the situation a little bit by warning users this case.

Signature · 1 line
Duy
#4 lore raw
Quoted 8 lines · Nguyen Thai Ngoc Duy
Quoted 4 lines · luis

Exactly!

so the next time someone (in windows) does a commit, they remove the file or the folder contents!

May be this commit dc1ae70 (Support case folding for git add when core.ignorecase=true).

I take it back. add_to_index() is mostly called by git-add. A checkout fills the index with unpack-trees, which does not seem to be case-insensitive to me.

Signature · 1 line
Duy