KiCAD footprint editor on Windows write Windows line-endings

Bug #1663990 reported by Jan Krieger
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Won't Fix
Undecided
Unassigned

Bug Description

We (library maintainers) are currently discussing a revised set of KLC-rules. In that process (https://github.com/KiCad/kicad-library/issues/879 https://github.com/SchrodingersGat/kicad-library/wiki/KLC) and due to some somments by contributors (https://github.com/KiCad/kicad-library/issues/799) we decided to use a single style of line-endings for all files where possible: We want to use UNIX-line-endings, i.e. only a LF, not CR!

Now it turns out that on windows platforms the KiCAD footprint editor always saves with Windows line-endings (i.e. CR+LF). It would be great to change that as this would reduce a lot of unnecessary file-changes that clutter the DIFFs.

Best,
JAN

Revision history for this message
Nick Østergaard (nickoe) wrote :

Is this also the case on kicad 4.0? The part about the file on windows.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1663990] Re: KiCAD footprint editor on Windows write Windows line-endings

AFAIK (unless someone changed it), the file output formatters always use
'\n' as the line end no matter what platform you are using. This was
done specifically to avoid platform specific line end issues. The files
produced should be the same no matter what platform they are created on
unless the platforms printf code is changing the '\n' to the platform
specific eol. This was done for portability.

On 2/22/2017 7:18 AM, Nick Østergaard wrote:
> Is this also the case on kicad 4.0? The part about the file on windows.
>

Revision history for this message
Bob Cousins (bobcousins42) wrote :

For files in text mode, translation of '\n' to local line ending is done automatically within libc. On Windows, this is translated to CR+LF. This behavior is correct.

Forcing all platforms to use LF is not the way to go.

If there is a problem with line-endings in git, this must be solved in git, e.g using the text attribute in .gitattributes.

Revision history for this message
José I. Romero (jose-cyborg) wrote :

I agree with Bob, this is a text format, not a binary one, line endings should be enforced at the git level.

Revision history for this message
Kevin Cozens (qq3dh7wn6set-fehmn-mm0v6n6x10rb) wrote :

I'm with Bob and José on this. Line endings in text files should always be in the native format on a users computer. To do otherwise makes it a potential problem for someone who needed to open up a text file that used LF only as a line ending. For example, on Windows some text editing programs would show a text file with LF only line endings as one continuous line. It would make the file hard to read.

Tell git which files contain text (when using non-standard file extensions) and use the autocrlf option of git to automatically convert line endings between the native format and the format used in the git maintained repostories.

Jeff Young (jeyjey)
Changed in kicad:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.