Dev: Opting the Path module into git newline normalization

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
gwicke
Posts: 10
Joined: Sun Oct 13, 2019 3:16 am
Location: California

Dev: Opting the Path module into git newline normalization

Post by gwicke »

Hi,

I just put up a diff to opt the Path module into git's newline optimization feature: https://github.com/FreeCAD/FreeCAD/pull/3506

This will effectively normalize newlines to internally use Unix LF throughout, but lets git checkouts use CRLF (DOS) line endings when that is the user / platform preference, for example on Windows. Newlines are normalized transparently on commit, so you can use DOS newlines for development, but your diffs will still contain Unix newlines.

The main benefit of this change is to avoid spurious diffs and conflicts from inadvertent newline changes. Avoiding such inadvertent changes can be difficult, especially when existing files use a mix of DOS and Unix newlines within the same file.

The biggest downside is the potential for conflicts with diffs that are outstanding right now. Git might help fix this up by applying auto-normalization on rebase, but there is potential for this to make the rebase more annoying.

Thanks to @vocx-fc for pointing me to the existing .gitattributes normalization setup.

Thoughts?

Gabriel
Post Reply