[Haskell-cafe] Cabal revision online form silently converts file to Windows line endings, breaking patches
Brandon Allbery
allbery.b at gmail.com
Tue May 14 14:51:32 UTC 2019
The main problem being that if they're using basic web upload for the file,
it's using network CRLF.
On Tue, May 14, 2019 at 7:05 AM Peter Simons <simons at nospf.cryp.to> wrote:
> Hi guys,
>
> > The diff program has an option to --ignore-trailing-space
> > (-Z for short) that will totally ignore changes of `\n`
> > to `\n\r` and vice versa. And so you will see only
> > 'actual' changes.
>
> more importantly, patch(1) has an option --ignore-whitespace
> that helps applying patches to a revised Cabal file which
> suddenly comes along with CRLF line endings. Using that flag
> with diff(1) when creating the patch is a good idea, but it
> won't make the patch resistant against failures when it's
> applied to a modified Cabal file.
>
> > Another generally useful option is --ignore-space-change
> > (-b for short) that will ignore indentation changes.
> > Another option that you may use is --ignore-all-space.
>
> This option is actually somewhat dangerous when applied in
> cases where the underlying source relies on layout to convey
> structure, because changes in indention will be lost with
> that flag enabled.
>
> Generally speaking, Hackage's policy of adding CRLFs to
> edited files seems like a bad idea. The least intrusive
> choice would be to follow whatever line-ending convention
> the original Cabal file has and to adhere to that.
>
> Anyway, I'll throw in a historical footnote for good
> measure: [1]
>
> Best regards,
> Peter
>
>
> [1] https://github.com/commercialhaskell/all-cabal-files/issues/11
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
--
brandon s allbery kf8nh
allbery.b at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20190514/729e2f49/attachment.html>
More information about the Haskell-Cafe
mailing list