{"thread":{"id":"45829","subject":"Bug: Git rename does not work if folder naming was changed from lower to upper case on OSX","startedAt":"2017-04-29T10:47:22Z","lastAt":"2017-05-01T17:07:21Z","messageCount":5,"participants":["Robert Eisele","Torsten Bögershausen","Kevin Daudt","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"318233","messageId":"10d4f73b-b4bd-4cf8-5727-cdaf10ab713a@xarg.org","threadId":"45829","inReplyTo":null,"subject":"Bug: Git rename does not work if folder naming was changed from lower to upper case on OSX","fromName":"Robert Eisele","fromEmail":"robert@xarg.org","sentAt":"2017-04-29T10:47:13Z","receivedAt":"2017-04-29T10:47:22Z","isPatch":false,"sender":{"key":"robert@xarg.org","avatar":null},"body":"Hi,\n\nafter having committed folders with lower case naming, I decided to \nrename them to upper-case names. Expecting git to detect them as \nrenamings, it started a new parallel hierarchy with new files, which I \nhad to add/commit.\n\nIt was a kinda strange behavior, which I fixed by rename the folder to \nsomething completely different, commit and rename the folder again to \nthe desired value.\n\nIs this an actual desired behavior or is it a bug?\n\nRobert\n\n"},{"id":"318239","messageId":"0f4f39c3-5c8f-8b3b-999b-57b9e3f27ac6@web.de","threadId":"45829","inReplyTo":"10d4f73b-b4bd-4cf8-5727-cdaf10ab713a@xarg.org","subject":"Re: Bug: Git rename does not work if folder naming was changed from lower to upper case on OSX","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2017-04-29T15:17:33Z","receivedAt":"2017-04-29T15:17:01Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"\n>\n> after having committed folders with lower case naming, I decided to rename them\n> to upper-case names. Expecting git to detect them as renamings, it started a\n> new parallel hierarchy with new files, which I had to add/commit.\n>\n> It was a kinda strange behavior, which I fixed by rename the folder to\n> something completely different, commit and rename the folder again to the\n> desired value.\n>\n> Is this an actual desired behavior or is it a bug?\n\nIt is expected (but may be unexpected), I hope these hints are not too harsh:\nYou can blame the vendor of the OS,\nwho decided to design a file system which ignores the case of files.\n(Or yourself, because you use it)\n(Or yourself, because you can install a HFS+ partition under OSX which\nis NOT case insensitive, but few people seem to know about this or use it)\n(harsh mode off)\n\nThe correct way to rename a file under Git is to use Git:\n\ngit init\nInitialized empty Git repository in /private/tmp/ttt/.git/\nuser@Mac:/tmp/ttt>mkdir dir1\nuser@Mac:/tmp/ttt>echo File >dir1/file\nuser@Mac:/tmp/ttt>git add dir1/file\nuser@Mac:/tmp/ttt>git commit -m \"add dir1/file\"\n[master (root-commit) 14d3862] add dir1/file\n  1 file changed, 1 insertion(+)\n  create mode 100644 dir1/file\nuser@Mac:/tmp/ttt>git mv dir1/file DIR1/FILE\nuser@Mac:/tmp/ttt>git commit  \"mv dir1/file DIR1/FILE\"\nuser@Mac:/tmp/ttt>git ls-files\nDIR1/FILE\n\n\n>\n> Robert\n>\n"},{"id":"318245","messageId":"20170429201813.GA19256@alpha.vpn.ikke.info","threadId":"45829","inReplyTo":"10d4f73b-b4bd-4cf8-5727-cdaf10ab713a@xarg.org","subject":"Re: Bug: Git rename does not work if folder naming was changed from lower to upper case on OSX","fromName":"Kevin Daudt","fromEmail":"me@ikke.info","sentAt":"2017-04-29T20:18:13Z","receivedAt":"2017-04-29T20:18:22Z","isPatch":false,"sender":{"key":"me@ikke.info","avatar":"https://avatars.githubusercontent.com/u/135698?v=4"},"body":"On Sat, Apr 29, 2017 at 12:47:13PM +0200, Robert Eisele wrote:\n> Hi,\n> \n> after having committed folders with lower case naming, I decided to rename\n> them to upper-case names. Expecting git to detect them as renamings, it\n> started a new parallel hierarchy with new files, which I had to add/commit.\n> \n> It was a kinda strange behavior, which I fixed by rename the folder to\n> something completely different, commit and rename the folder again to the\n> desired value.\n> \n> Is this an actual desired behavior or is it a bug?\n> \n> Robert\n> \n\nNote that git does not store that files are renamed. So a remove + add\nis the same as a rename in git. Only git status shows it when you for\nexample use git mv directly, but this information is lost on commit.\nInstead of storing it get relies on detecting what (parts of ) files got\nrenamed, copied etc.\n"},{"id":"318283","messageId":"xmqqshkpic0e.fsf@gitster.mtv.corp.google.com","threadId":"45829","inReplyTo":"20170429201813.GA19256@alpha.vpn.ikke.info","subject":"Re: Bug: Git rename does not work if folder naming was changed from lower to upper case on OSX","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-05-01T01:47:29Z","receivedAt":"2017-05-01T01:47:36Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kevin Daudt <me@ikke.info> writes:\n\n> Note that git does not store that files are renamed. So a remove + add\n> is the same as a rename in git. Only git status shows it when you for\n> example use git mv directly, but this information is lost on commit.\n\nAre you sure about the last sentence?  I do not recall teaching\nanything special to \"git status\".  If \"git status\" says A was\ncreated by renaming B, and if you committed that state was-is, \"git\nshow\" on the result commit _should_ say the same thing, I would\nthink.\n\n> Instead of storing it get relies on detecting what (parts of ) files got\n> renamed, copied etc.\n\nThat statement I belieave is true.\n"},{"id":"318380","messageId":"20170501170714.GA17703@alpha.vpn.ikke.info","threadId":"45829","inReplyTo":"xmqqshkpic0e.fsf@gitster.mtv.corp.google.com","subject":"Re: Bug: Git rename does not work if folder naming was changed from lower to upper case on OSX","fromName":"Kevin Daudt","fromEmail":"me@ikke.info","sentAt":"2017-05-01T17:07:14Z","receivedAt":"2017-05-01T17:07:21Z","isPatch":false,"sender":{"key":"me@ikke.info","avatar":"https://avatars.githubusercontent.com/u/135698?v=4"},"body":"On Sun, Apr 30, 2017 at 06:47:29PM -0700, Junio C Hamano wrote:\n> Kevin Daudt <me@ikke.info> writes:\n> \n> > Note that git does not store that files are renamed. So a remove + add\n> > is the same as a rename in git. Only git status shows it when you for\n> > example use git mv directly, but this information is lost on commit.\n> \n> Are you sure about the last sentence?  I do not recall teaching\n> anything special to \"git status\".  If \"git status\" says A was\n> created by renaming B, and if you committed that state was-is, \"git\n> show\" on the result commit _should_ say the same thing, I would\n> think.\n\nYes, of course, you are right. Git status also detects a file being\nrenamed instead of relying on it being recorded.\n> \n> > Instead of storing it get relies on detecting what (parts of ) files got\n> > renamed, copied etc.\n> \n> That statement I belieave is true.\n\nWhy are you reserved here?\n\nKevin.\n"}]}