I have added an appropriate (I hope) .gitattributes file to the Corinthia 
repository.

For SVN, it is necessary to make local changes to adjust line-endings 
cross-platform.  The relevant ASF file for this is at 
<http://www.apache.org/dev/svn-eol-style.txt>.

It turns out I have a custom one of these *and* it is in effect.  The problem 
was I had replaced the rules for *.html and *.htm with ones that specified the 
MIME type and removed the svn:eol-style attribute, thinking it didn't matter.  
My bad. I did that years ago! (June 2011)  It does matter for DIFF and for what 
others think the "right" line ending is.

I have fixed that in my local SVN settings.

PS: I have the SVN definitions for the ODF documents, and I need to update them 
for the Microsoft Office documents.  I assume that having these binaries is all 
right in collections of test documents, so long as they are not in the part of 
our repositories that represent released source code.

 - Dennis

-----Original Message-----
From: Dennis E. Hamilton [mailto:[email protected]] 
Sent: Tuesday, January 6, 2015 12:48
To: [email protected]
Subject: RE: Coding Standards page



 -- replying below to --
From: jan i [mailto:[email protected]] 
Sent: Tuesday, January 6, 2015 11:38
To: [email protected]
Subject: Re: Coding Standards page

On Tuesday, January 6, 2015, Peter Kelly <[email protected]> wrote:

> > On 7 Jan 2015, at 1:26 am, Dennis E. Hamilton <[email protected]
> <javascript:;>> wrote:
[ ... ]
> > I notice that the requirement for Unix line endings is not included, nor
> is there information on how to control that when working with the
> repository.
>
> Yes - we need to state this and also explain how this can be enforced with
> a git configuration option (something I haven’t had a chance to look into
> yet).

This is not really coding standard but git usage, but its ok for me if we
mix it all.

<orcmid>
   Well, the problem is we can't just tell everyone they have to use Unix
   Newline codes and not use CR-LF.  First, it makes no sense if they are
   operating on Windows, and it only matters for code that is exchanged
   via the repo. (It matters for patches too, but my brain just exploded.)
   
   That means we need to explain how to ensure that only Unix Newline codes
   end up in the repository, which is where it matters.

   I did find out where in GitHub there is information about this.  Here it
   is again:

    The line-ending does have controls in SVN and Git configurations.  
    So long as a file is known to be text, there are controls in place.  
    Here is GitHub on the subject, 
       <https://help.github.com/articles/dealing-with-line-endings/>.

    Note that it is very important to be certain that Git knows what files 
    *not* to make these adjustments on, since it will damage binaries too 
    when they are not excluded from treatment as text.  I don't know how 
    much this impacts PGP-signed material.

    I suggest the .gitattributes approach be set up in the Corinthia 
    repository with text=auto and the indicated examples.  After that is 
    done, those of us using Windows may need to re-clone the repository 
    to have everything in sync.

   PS: I have no idea how line ends show up in the batch scripts I 
   put on the repository.  They work fine for me, of course.
</orcmid>

[ ... ]

Reply via email to