From: Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
To: git@vger.kernel.org
Subject: EOL handling (EGit/svn/Windows)
Date: Mon, 9 Feb 2015 23:22:19 +0100 [thread overview]
Message-ID: <CAA01Csrp0ZOouM5zhVuHQW9sWCnbMMLRkmcbRtgsU3k8wNtSqw@mail.gmail.com> (raw)
Hi,
in short: how to do svn->git conversion, or how to configure git/EGit
so that Windows/Linux users are happy with EOLs?
Long story:
recently I converted (with git-svn) an svn repository to git. This
created git repository with Windows (CRLF) end of line files. I
suppose the original svn repository had Windows EOLs (I did the
conversion on linux). The development is done in Eclipse (mostly on
Windows), so the EGit is a natural choice for git client.
But the problem appears: what should be the core.eol and core.autocrlf settings?
EGit seems to have problems with core.autocrlf=true - it always
converts files to LF on commit. So if someone modifies one line in a
file which was not modified yet since the git->svn conversion, each
line is seen as modified (CRLF changed to LF). It seems like a bug in
EGit - git-config man page says "files that contain CRLF in the
repository will not be touched" for core.autocrlf=true. "Normal"
command line git works better - if a file has CRLF in it in
repository, it will not convert it (it will convert new files from
CRLF to LF though - that's OK).
I could also set core.autocrlf=false which should avoid any conversion
to LF on check-in. This will move the responsibility of using correct
EOL to users. Everyone, both Windows and Linux users, will have to use
the same EOLs. Probably core.eol will have to be set to crlf, the same
as in repo. But I suppose this will not work - new files will be
created with native EOLs so the files will end up being checked in
like that. I also think it might create some problems with programs
not accepting non-native EOLs. On the other hand, it would prevent
problems caused by CRLF->LF conversion on "binary" files incorrectly
detected as "text" files...
So maybe I should re-write the repository (all the history) so that
the files are converted to LF? (examples:
http://superuser.com/questions/293941/rewrite-git-history-to-replace-all-crlf-to-lf
http://blog.gyoshev.net/2013/08/normalizing-line-endings-in-git-repositories/).This
way I should be able to use core.autocrlf for both git and EGit.
That's what I'm favoring currently. The downside is that, if I assume
correctly that SVN repo kept files in CRLF format, the conversion to
LF might break something (not sure what - some UTF files? or some
unexpected stuff...).
This re-writing of repo would not be needed if EGit did work like
normal git... should I drop EGit? I would prefer not to :(
Any other suggestions?
BTW, core.autocrlf documentation in git-config is a bit hard to
understand... it's not obvious what it affects - working dir? commits?
Does it convert to CRLF or LF? What is the "input" setting (what is
"output conversion")? I found some explanation here:
http://thread.gmane.org/gmane.comp.version-control.git/174413
Thanks,
--
Piotr Krukowiecki
next reply other threads:[~2015-02-09 22:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-09 22:22 Piotr Krukowiecki [this message]
2015-02-10 5:49 ` EOL handling (EGit/svn/Windows) Torsten Bögershausen
2015-02-10 10:52 ` Piotr Krukowiecki
2015-02-10 15:32 ` Torsten Bögershausen
2015-02-11 11:46 ` Piotr Krukowiecki
2015-02-11 15:51 ` Piotr Krukowiecki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAA01Csrp0ZOouM5zhVuHQW9sWCnbMMLRkmcbRtgsU3k8wNtSqw@mail.gmail.com \
--to=piotr.krukowiecki@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).