EOL conversion nits

From: Jay Soffian <hidden>
Date: 2016-06-15 22:50:49

Create a repo with a single DOS EOL file:

  git init foo && cd foo &&
  printf 'foo\r\nbar\r\n' > foobar &&
  git add foobar &&
  git commit -m foobar

Normalize the repo:

  echo 'foobar eol=lf' > .gitattributes &&
  rm .git/index && git reset
  Unstaged changes after reset:
  M	foobar

Commit the changes:

  $ git add .gitattributes foobar
  warning: CRLF will be replaced by LF in foobar.
  The file will have its original line endings in your working directory.

  $ git commit -m normalize
  warning: CRLF will be replaced by LF in foobar.
  The file will have its original line endings in your working directory.
  [master f86ff53] normalize
  warning: CRLF will be replaced by LF in foobar.
  The file will have its original line endings in your working directory.
   2 files changed, 3 insertions(+), 2 deletions(-)
   create mode 100644 .gitattributes

So, there's a few issues here:

1. Why is git warning me three times about the EOL conversion?
Shouldn't once, on commit, be sufficient?

2. Shouldn't the message use "working tree", not "working directory"?

3. The git attributes help doesn't say how to convert the line endings
in the working tree, which I guess is:

  $ rm .git/index && git reset --hard

4. I wonder why git's keeping the original line endings in the working
tree post-normalization, but minimally, I think it should provide a
friendlier way to update the working tree line endings to match what
you'd get from a fresh checkout, honoring whatever your EOL settings
are.

Thoughts?

j.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help