--default-eol for conversions to GIT

sags <[email protected]> Sun, 5 Apr 2015 15:50:41 -0700 (PDT)
Newsgroups gmane.comp.version-control.subversion.cvs2svn.devel
Message-ID <1397649435.4262.1428274241969.JavaMail.httpd@localhost>
------=_Part_4263_17086396.1428274243108
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi all (again!),

Here is another suggested patch, this time one that activates the --default-eol command-line option for conversions to GIT.

Previously, all the work was done the same as for conversions to SVN up to and including the setting of svn:eol-style. The only missing part was to set _eol_fix based on svn:eol-style.

I needed this to work around J/GIT (and anything that uses it, like Eclipse and GitEye) not handling .gitattributes, which bothers a lot on Windows and can lead to data corruption.

Details:
- Text files are normally stored with LF line endings in both CVS and
  GIT repos.
- Windows tools want CRLF line endings in the working copy.
- CVS has text-or-binary markers stored into the repo and, for text
  files, does EOL conversions on checkin/checkout as needed.
- GIT does not have such markers in the repository, instead it has a 
  core.autocrlf property. On Windows this is initialized to true to do
  the EOL translations as CVS does.
- Unfortunately core.autocrlf is repo-wide, not per-file, so in order
  not to damage binary files (when core.autocrlf=true) GIT relies on 
  guesswork.
- Not a surprise this guesswork fails sometimes. To fix this there is a 
  .gitattributes file that, among other things, can specify per-file
  text-or-binary status.
- J/GIT ignores .gitattributes so in order to be sure not to damage
  binary files we have to set core.autocrlf=false on the repo.
- But then no EOL conversion is done on checkin/checkout, all files
  are treated as if they were binary.
- So to get CRLF on checkout, we must have CRLF inside the repository.
  Here comes --default-eol=CRLF: converts LF EOLs from the CVS repo to
  CRLF EOLs in the GIT repo.

Hope that will be of some help,
sags

------------------------------------------------------
http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1667&dsMessageId=3110859

To unsubscribe from this discussion, e-mail: [[email protected]].
------=_Part_4263_17086396.1428274243108
Content-Type: application/zip; name=Default-eol-if-converting-to-GIT.zip
Content-Transfer-Encoding: base64
Content-Disposition: attachment; 
	filename=Default-eol-if-converting-to-GIT.zip

UEsDBBQAAAAIAGcChkaaOAYA0w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