{"thread":{"id":"31852","subject":"config core.autocrlf changes the index","startedAt":"2012-10-17T18:30:35Z","lastAt":"2012-10-17T18:30:35Z","messageCount":1,"participants":["Angelo Borsotti"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"201442","messageId":"CAB9Jk9DPLjRDino0A4LotEXC6BSNAjftEUtPQb2bo1TKXPAd+Q@mail.gmail.com","threadId":"31852","inReplyTo":null,"subject":"config core.autocrlf changes the index","fromName":"Angelo Borsotti","fromEmail":"angelo.borsotti@gmail.com","sentAt":"2012-10-17T18:30:35Z","receivedAt":"2012-10-17T18:30:35Z","isPatch":false,"sender":{"key":"angelo.borsotti@gmail.com","avatar":null},"body":"Hello,\n\ngit config config core.autocrlf changes the index file, apparently\nmaking obsolete its contents\nwhen a repository is cloned.\nRun the following script:\n\n# create a bare repository, empty\nrm -rf rel.git\nmkdir rel.git\ncd rel.git\ngit init --bare\ngit config core.autocrlf false\ncd -\n\n# populate the bare repository\nrm -rf temp\ngit clone rel.git temp\ncd temp\necho aaa>f1\ngit add f1\ngit commit -m A\ngit push origin master\ncd -\nrm -rf temp\n\n# clone then the bare repository\nrm -rf int\nmkdir int\ngit clone rel.git int\ncd int\ngit status\ngit ls-files -s --debug\n# (1)\n# change then core.autocrlf in the config\ngit config core.autocrlf false\ngit status\ngit ls-files -s --debug\n# (2)\ncd -\n\nAt (1), git status reports \"nothing to commit\", but at (2) it reports:\n\n On branch master\n Changes not staged for commit:\n   (use \"git add <file>...\" to update what will be committed)\n   (use \"git checkout -- <file>...\" to discard changes in working directory)\n\n       modified:   f1\n\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n\nThe two git ls-files -s --debug commands report also differences in the index.\n\nThis seems rather strange, although one can think that changing\ncore.autocrlf might imply that the files in the workspace might have\nno longer the same contents that they had should they have benn\nchecked out with the new core.autocrlf.\nBe as it is, at least this unexpected effect of changing core.autocrlf\nshould be documented.\n\n-Angelo Borsotti\n"}]}