Thursday, May 03, 2012

Mac OSX + git : file name upper/lower case bug

요새 python으로 밤에 한 30분씩 쪼물딱 거리면서 놀고 있는데, github에 올려놓고 관리를 하고 있음.

주로 애를 재우고 그 옆에 엎드려서 맥북으로 코딩을 하는데, 간만에 python을 짰더니, 영 모양이 이상한거라. 그래서 간만에 PEP-8을 정독하고 코딩 컨벤션에 맞춰서 클래스명, 변수명, 메소드 명 등등을 다 고쳤는데, 문제는 모듈명이었다. 즉, 디렉토리명, 파일명을 소두낙타표법으로 (wordAnotherWord) 했는데, 이걸 다 소문자로 바꿔야겠더라구.

그래서 git mv memoHerd memoherd 라고 했는데, 이미 있는 이름이라 안된다는 거임.

음. 잠시 고민하다가... git 은 요상하네;;; 하고 그냥 mv로 파일, 디렉토리 이름들을 다 바꾸고 git commit했는데, 그 결과가 다른 작업들(파일 내의 대소문자 수정)만 반영되는 것 같았음. 그래도 설마 진짜 그랬겠어? 하고 git push한 다음 github가서 봤더니, 디렉토리/파일명 대소문자는 그대로인 거임.

그래서 구글느님께 문의한 결과, git config 중에 core.ignorecase란 놈이 있는데, 일단 맥버전은 이게 true로 되어있다는 거야. 헐... HFS+ 가 원래 좀 그런 놈이라 그렇다는 데 자세한 건 잘 모르겠지만, 이 그지같은 Mac 파일 시스템은 디렉토리마다 숨은 똥을 싸 놓는 것으로도 부족해서 그런 그지같은 속성이 있을 줄이야....

그래서 git config --global core.ignorecase false라고 하고 잘 되었겟지..
하고 다시 git status를 했는데 바뀐게 없뜸....

대 좌절.

결론은
파일/디렉토리 이름들을 다른 걸로 바꾸고 git commit
다시 원복하고 git commit

그리고 git push 했음.

빌어먹을.



*********************************************************
Problem:
On Mac OSX, file name cases are ignored by git.
Changing "fileName" to "filename" was ignored by git status, git commit, git push.

Cause:
They say, on OSX and HFS+, git is set to ignore cases by default.

Solution:
git config --global core.ignorecase false

Another problem:
If you have changed the file/directory name already, (same name in different cases) setting the core.ignorecase value to false does not make git to notice the change.

solution:
Change the file/directory name to another and git add/commit.
and then, change it back and git commit again.


I don't know what to blame, but I would rather blame OSX and the HFS+ than git.