That was
helpful. Clearly, I was misunderstanding the meaning of “auto”.
Being a long-time Mac user, I have been accustomed to
autocrlf=input and was thinking that auto was the reason why I
was getting CRLF endings when, in fact, the opposite was true:
I am now getting LF endings in the index for files that
autocrlf=input was leaving as CRLF in the index. What I wasn’t
understanding before was that the entire discussion isn’t about
the line endings in the checkout workspace, but rather it’s
about the line endings in the index, which accurately
reflects what will end up in the shared repository.
So, if
my new understanding is correct, I am more comfortable. I now
am sitting on a commit that converts the line endings of
nearly 16000 files (see transcript, below). Oddly, though, I
still see that Benoit’s script finds a few hundred text files
that have CRLF endings, for what reason I don't know. I won’t
be entirely comfortable until I know what’s going on with
those.
Another
question that concerns me: we know that JGit doesn’t support
the .gitattributes file, at least not the line-ending settings
in it. So, if I were to push these thousands of changes, what
would the impact be afterwards of developers using EGit to
commit changes:
- on Windows with config.autocrlf=false? Wouldn’t that
introduce CRLFs back into the repo?
- on Linux/Mac with config.autocrlf=??? ? Can these people
do any further damage to the repo once it has been LFized?
I suspect not
Which is all to say that I think the long-term viability
of the plan still depends on Windows users all continuing to
have core.autocrlf=true in their global configs, which is
probably the case and isn’t a new requirement/constraint
anyways.
Cheers,
Christian
————
8< ————
✓ 🍔 0 591 ~/git/Papyrus (master) $ git commit -m
"Normalize all the line endings"
warning: CRLF will be replaced by LF in
extraplugins/facade/org.eclipse.papyrus.facade.editor/plugin.properties.
The file will have its original line endings in your
working directory.
warning: CRLF will be replaced by LF in
extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.editor/plugin.properties.
The file will have its original line endings in your
working directory.
warning: CRLF will be replaced by LF in
extraplugins/soaml/org.eclipse.papyrus.soaml.profile.validation/plugin.xml.
The file will have its original line endings in your
working directory.
warning: CRLF will be replaced by LF in
plugins/customization/org.eclipse.papyrus.infra.gmfdiag.expansion.editor/plugin.properties.
The file will have its original line endings in your
working directory.
warning: CRLF will be replaced by LF in
plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/plugin.properties.
...
The file will have its original line endings in your
working directory.
warning: CRLF will be replaced by LF in
plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing/plugin.properties.
The file will have its original line endings in your
working directory.
warning: CRLF will be replaced by LF in
plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/plugin.properties.
The file will have its original line endings in your
working directory.
warning: CRLF will be replaced by LF in
tests/debug/plugins/core/org.eclipse.papyrus.extendedtypes.editor/plugin.properties.
The file will have its original line endings in your
working directory.
warning: CRLF will be replaced by LF in
tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/plugin.properties.
The file will have its original line endings in your
working directory.
15796 files changed, 3434099 insertions(+), 3434099
deletions(-)
✓ 🍔 0 592 ~/git/Papyrus (master) $ checkcrlf
CRLF: 281
All EOLs must be LF and not CRLF. See target/crlf.log for
details.