[PATCH] dim: handle parse failures in apply_pull better

Lukas Wunner lukas at wunner.de
Mon Apr 30 07:15:05 UTC 2018


On Mon, Apr 30, 2018 at 09:10:06AM +0200, Daniel Vetter wrote:
> On Mon, Apr 30, 2018 at 9:08 AM, Lukas Wunner <lukas at wunner.de> wrote:
> > On Mon, Apr 30, 2018 at 08:29:57AM +0200, Daniel Vetter wrote:
> >> We're relying on get fetch failing and set -e, but that doesn't work
> >> if we parse nothing: In that case git fetch just fetches upstream and
> >> succeed. Dave stumbled over this by feeding a .mbox with dos linefeeds
> >> into dim.
> >
> > How about eliminating the carriage returns (not linefeeds!) by
> > automatically funneling stdin through /usr/bin/tr -d '\r'
> >
> > (Sorry, I'm not familiar enough with dim source code and this
> > use case to provide a patch.)
> 
> Yeah that's easily doable, there's only a few entry points where we
> parse external mboxes. I'm just wondering whether it's worth the
> bother (since mbox files shouldn't have dos style line endings).

CRLF line endings may also occur when copy/pasting from a terminal
window.  OTOH that will often also replace tabs with spaces,
potentially wrecking a patch, so it might indeed be better to fail.

Thanks,

Lukas


More information about the dim-tools mailing list