[Kde-scm-interest] Git hooks update

Johannes Sixt j.sixt at viscovery.net
Tue Jun 22 10:18:24 CEST 2010


Am 6/22/2010 9:35, schrieb Thiago Macieira:
> Em Terça-feira 22. Junho 2010, às 09.20.53, Ben Cooksley escreveu:
>> 2010/6/22 Thiago Macieira <thiago at kde.org>:
>>> Does it respect .gitattributes settings? E.g., how do I add a CRLF file
>>> for, say, testing?
>>
>> Not at this time, as I wasn't able to determine what the format of the
>> file should be....
>>
>> http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
>>
>> would an appropriate line be:
>>
>> an-crlf-file.cpp crlf
> 
> Actually, -crlf, which means "don't apply the crlf transform".

Watch out: -crlf and crlf can be one among several tokens that are
separated by blanks.

But I suggest that you do not try to parse and interpret .gitattribute
files yourself. The interaction between .gitattribute files at different
levels in the hierarchy is subtle. I suggest to parse the output of git
diff --check (or git show --check) instead of doing it all manually. (And
then a line in .gitattributes would have to be

  crlf-file -crlf whitespace=cr-at-eol

We can talk off-list about details.)

-- Hannes

-- 
"Atomic objects are neither active nor radioactive." --
Programming Languages -- C++, Final Committee Draft (Doc.N3092)


More information about the Kde-scm-interest mailing list