----- Original Message -----
> From: "Alan Conway" <[email protected]>
> To: [email protected]
> Sent: Friday, September 2, 2016 10:44:35 AM
> Subject: Re: gitattributes
> 
> On Fri, 2016-09-02 at 08:49 +0200, Volker Diels-Grabsch wrote:
> > Matt Broadstone schrieb:
> > > 
> > > Would it be possible to fix up the .gitattributes for the qpid-cpp
> > > git
> > > repository? I'm having an incredibly hard time updating the sources
> > > for the
> > > debian packaging because there are many mixed in CRLF files
> > > throughout the
> > > repository (seemingly without rhyme or reason either, i.e. not all
> > > .ps1 or
> > > .bat files have CRLF line endings). Anyone know how to clean this
> > > up easily?
> > 
> > This sounds like it should be really cleaned up in the repository and
> > not just on packaging.  Maybe the following helps.  This is my
> > general
> > way to cleanup sources, i.e. not specific for qpid-cpp.
> > 
> > You can cleanup e.g. all "*.cpp" and "*.in" files with a single
> > command:
> > 
> >     cd qpid-cpp-0.34
> >     find * -type f -name '*.cpp' -exec sed 's/\r//g' -i {} \;
> >     find * -type f -name '*.in' -exec sed 's/\r//g' -i {} \;
> 
> That will only work until folks start re-editing the files with their
> random win/unix editors and change the endings again. If you want it to
> stay pure forever I think we need .gitattributes to define file types
> by extension as "text" so that git normalizes them, and then let users
> set their core.eol to whatever they prefer for text files in their
> working tree. Its probably more complicated than that but you see what
> I'm getting at...
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 

Setting this stuff up in .gitattributes will override user core.autocrlf.
This is what we want. It keeps the repo in good shape but also lets 
users have different LF/CRLF in their work areas. And it will 'correct'
a user (like me) who naively tries to switch line endings here or there
on a commit. Some of the line ending issues were present before the 
migration from SVN.

There will be an interesting flag day when the correction pass happens.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to