Degenerate behaviour from bzr diff
Paul Moore
p.f.moore at gmail.com
Mon Sep 24 21:09:29 BST 2007
On 24/09/2007, Michael Alan Dorman <mdorman at tendentious.org> wrote:
> On Mon, 24 Sep 2007 20:50:35 +0100
> "Paul Moore" <p.f.moore at gmail.com> wrote:
>
> > I just tried using bzr to manage a quick patching session. Nothing
> > fancy, grab a small distribution, bzr init, hack a bit, then bzr diff
> > to create a patch.
> >
> > Or so I thought. In spite of the changes being pretty small, bzr diff
> > chose to show the complete file being replaced! Clearly completely
> > useless as a patch to send back upstream :-(
> >
> > I was originally using bzr 0.18, but I updated to 0.91 rc 2, and get
> > the same behaviour.
> >
> > Any suggestions?
>
> I can't help but notice you are on Windows. Did your editor change the
> line endings?
Aaaaaargh!!!!
You're absolutely right. Well, sort of. My *editor* (vim) didn't
change the line endings (I won't use an editor that can't keep line
endings in the form the file had them in). However, I created the new
version of my file via "patch", rather than directly in my editor, and
the version of patch I have on Windows *does* mangle line endings.
The irony is that I'm a strong believer in programs never mangling
line endings on Windows - either \r\n or \n should be valid, but they
are *not* interchangeable. That's why I use programs like bzr in the
first place. Grumble. I really must find a version of patch that
preserves line endings properly.
Thanks for noticing this. I wonder - would it be possible for bzr to
notice this (obviously not uncommon!) mistake, and issue a warning?
Paul.
More information about the bazaar
mailing list