{"thread":{"id":"26799","subject":"EOL conversion nits","startedAt":"2011-03-19T23:10:17Z","lastAt":"2011-03-19T23:10:17Z","messageCount":1,"participants":["Jay Soffian"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"163791","messageId":"AANLkTimML1Q-2Eyy=F_y+Z0qy6VrnqtwCUQN-23nuPD8@mail.gmail.com","threadId":"26799","inReplyTo":null,"subject":"EOL conversion nits","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2011-03-19T23:10:17Z","receivedAt":"2011-03-19T23:10:17Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"Create a repo with a single DOS EOL file:\n\n  git init foo && cd foo &&\n  printf 'foo\\r\\nbar\\r\\n' > foobar &&\n  git add foobar &&\n  git commit -m foobar\n\nNormalize the repo:\n\n  echo 'foobar eol=lf' > .gitattributes &&\n  rm .git/index && git reset\n  Unstaged changes after reset:\n  M\tfoobar\n\nCommit the changes:\n\n  $ git add .gitattributes foobar\n  warning: CRLF will be replaced by LF in foobar.\n  The file will have its original line endings in your working directory.\n\n  $ git commit -m normalize\n  warning: CRLF will be replaced by LF in foobar.\n  The file will have its original line endings in your working directory.\n  [master f86ff53] normalize\n  warning: CRLF will be replaced by LF in foobar.\n  The file will have its original line endings in your working directory.\n   2 files changed, 3 insertions(+), 2 deletions(-)\n   create mode 100644 .gitattributes\n\nSo, there's a few issues here:\n\n1. Why is git warning me three times about the EOL conversion?\nShouldn't once, on commit, be sufficient?\n\n2. Shouldn't the message use \"working tree\", not \"working directory\"?\n\n3. The git attributes help doesn't say how to convert the line endings\nin the working tree, which I guess is:\n\n  $ rm .git/index && git reset --hard\n\n4. I wonder why git's keeping the original line endings in the working\ntree post-normalization, but minimally, I think it should provide a\nfriendlier way to update the working tree line endings to match what\nyou'd get from a fresh checkout, honoring whatever your EOL settings\nare.\n\nThoughts?\n\nj.\n"}]}