[fpc-pascal] Git line endings leading to patch problems - was [Semi-OT] Git format patches don't seem to work

Reinier Olislagers reinierolislagers at gmail.com
Thu Oct 6 16:59:29 CEST 2011


On 6-10-2011 16:56, Alex Shishkin wrote:
> 06.10.2011 16:37, Reinier Olislagers пишет:
>> On 4-10-2011 14:41, Reinier Olislagers wrote:
>>> On 4-10-2011 13:14, Marco van de Voort wrote:
>>>> In our previous episode, Reinier Olislagers said:
>>>>> Having some trouble creating patches that actually work.
>>>>> (On Windows)
>>>>> I've been using git to get FPC trunk and
>>>>> git diff --no-prefix>  %temp%\mypatch.diff
>>>> I don't know about GIT, but some tips:
>>>>
>>>> 1. Play with lineending.  (I use cygwin's dos2unix and unix2dos to
>>>> convert)
>> Ok, I've looked at it some more:
>> Example:
>> packages\fcl-extra\src\win\ServiceManager.pas
>>
>> svn:
>> via web:
>> http://svn.freepascal.org/svn/fpc/trunk/packages/fcl-extra/src/win/ServiceManager.pas
>>
>> =>  Unix line endings
>> Local svn:
>> svn proplist -v packages\fcl-extra\src\win\ServiceManager.pas
>>    svn:eol-style
>>      native
>> so:
>> =>  WINDOWS LINE ENDINGS
>> Therefore patch.exe on Windows probably works
>>
>> Git:
>> https://github.com/graemeg/freepascal/raw/7026b7669fd422f88ffe33174dac1725c0295427/packages/fcl-extra/src/win/ServiceManager.pas
>>
>> =>  Unix line endings!!!!
>> via git pull etc
>> =>  Unix line endings
>> not surprising...
>>
>> Seems the SVN client is converting line endings to my native format.
>>
>> Seems also that there is no way to get git to convert remote LF to local
>> CRLF...
>>
>>
>> Should I give up on git and just switch to SVN?
>>
>> I'm sure some more knowledgeable/alert person will have a suitable
>> answer!
>>
>> Thanks,
>> Reinier
>>
> there is git config option "core.autocrlf" try to use it

Thanks Alex, I already fiddled with that. I'll try again with
core.autocrlf set to true and false to make sure it doesn't work...




More information about the fpc-pascal mailing list