[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 14:37:45 CEST 2011


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



More information about the fpc-pascal mailing list