DOS line endings makes applying patches on Linux really hard

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
Kunda1
Posts: 5761
Joined: Thu Jan 05, 2017 9:03 pm

DOS line endings makes applying patches on Linux really hard

Postby Kunda1 » Fri Jan 13, 2017 10:29 pm

issue #1352 from 2014
Do we want to document the @shoogen workaround ?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
sgrogan
Posts: 5416
Joined: Wed Oct 22, 2014 5:02 pm

Re: DOS line endings makes applying patches on Linux really hard

Postby sgrogan » Sat Jan 14, 2017 2:22 am

Related forum topic: viewtopic.php?t=15443
User avatar
kkremitzki
Posts: 1757
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: DOS line endings makes applying patches on Linux really hard

Postby kkremitzki » Sat Jan 14, 2017 10:39 am

What is the workaround exactly? Removing Windows line endings on files as they're touched/as needed by package maintainers?
IMHO adding a single commit to our repo that will remove all Carriage Returns has some drawbacks.
The most important is that it will render the "git blame" command useless and that will make the repo bigger.
Wouldn't this flag from man git-blame address that?

Code: Select all

       -w
           Ignore whitespace when comparing the parent’s version and the child’s to find where the lines came from.
IMO getting rid of Windows line endings piecemeal is not a great solution. You still end up with the same issue of a big commit making the revision history less useful. The alternative is a history-rewriting change that will mess up people's cloned repos, forks, etc. This will have some pain, but so does ripping off a bandaid. There are tools specifically for this, see git-filter-branch: https://git-scm.com/docs/git-filter-branch

The number of people who are actively working off & contributing from cloned repos is probably pretty manageable, and as long as a clear path for getting through it (arrived by testing, which I can help with) is included with the announcement that it's going to happen, it should be fine.

I'm not sure what runtime path issues jobermayr is referring to, but other concerns like conforming to the filesystem hierarchy and mixed line endings are valid and I think if they are reasonably fixable they should be. (BTW there's 1.34 million hits for "mixed line endings issues" on Google for me.)
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.