Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] FileTreeIterator and EOLs

> We haven't put much thought into how to handle CRLF conversion yet.  I
> think its the right idea to perform CRLF conversion before computing
> the ObjectId for an entry.  Or running the clean filter if configured
> for the file type.  So it probably makes sense to do it here.  But not
> in the FileTreeIterator, it should be higher up in the
> WorkingTreeIterator.

I've submitted a corresponding patch now:

http://egit.eclipse.org/r/#change,1179.

It addresses only core.autocrlf property in the FileTreeIterator, i.e.
for read access. It may serve as foundation for new core.eol and
text/eol attributes, introduced with Git 1.7.2.

Also, there is only a test for the core input stream, but not for the
WorkingTreeIterator resp. FileTreeIterator. I couldn't figure out an
easy way to create a corresponding test repository with simple file
contents.

--
Best regards,
Marc Strapetz
=============
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com



Shawn Pearce wrote:
> On Sat, Jul 24, 2010 at 10:55 AM, Marc Strapetz
> <marc.strapetz@xxxxxxxxxxx> wrote:
>> I think the FileTreeIterator should optionally perform EOL
>> canonicalization to \n (for text files). This option would be set by the
>> caller if core.autocrlf = true. We have already re-implemented
>> FileTreeIterator this way. Should I submit this patch?
> 
> Are you talking about the computation of the ObjectId for the current entry?
> 
> We haven't put much thought into how to handle CRLF conversion yet.  I
> think its the right idea to perform CRLF conversion before computing
> the ObjectId for an entry.  Or running the clean filter if configured
> for the file type.  So it probably makes sense to do it here.  But not
> in the FileTreeIterator, it should be higher up in the
> WorkingTreeIterator.
> 
> Unfortunately that is only the code path related to cleaning a dirty
> index entry.  Adding a file to the repository also needs to do the
> CRLF conversion.
> 


Back to the top