Submit by mail
Michael Ellerman
michael at ellerman.id.au
Wed Jun 14 05:37:11 BST 2006
On Wed, 2006-06-14 at 05:57 +0200, Matthieu Moy wrote:
> Michael Ellerman <michael at ellerman.id.au> writes:
>
> >> One of the problems is that the line separator is not always constant--
> >> some files mix LF and CRLF. Another is that whitespace at the end of
> >> lines is often eaten, or used to indicate a soft break in format=flowed
> >> text.
> >
> > Yeah, I feel your pain. Unfortunately I think it's human to consider
> > whitespace as insignificant in any format that _looks like text_. The
> > easy option might be just to ignore the textual diff, and use a base64
> > encoded one. Although then some idiot user will edit the diff and expect
> > that to hold :)
>
> You can also keep the textual diff, and add some somewhat encoded
> information after it, that would be ignored by patch, but used by bzr
> merge.
>
> Like
>
> --- foo 2006-06-14 09:24:02.824978750 +0530
> +++ bar 2006-06-14 09:24:15.609777750 +0530
> @@ -4,7 +4,7 @@
> a
> a
> a
> -a
> +b
> a
> a
> a
> # Line-endings: uuuuwuuu
>
> (my encoding here meaning "unix for the 4 first lines of the patch,
> windows for the 5th one, and unix for the 3 last ones", but one could
> imagine anything else here)
>
> I'd find it quite ugly, but at least, you'd keep the patch, and the
> reproducible result.
Hmm, yeah it sure is ugly. Another problem is just trailing whitespace,
as opposed to line endings.
--- foo 2006-06-14 09:24:02.824978750 +0530
+++ bar 2006-06-14 09:24:15.609777750 +0530
@@ -4,7 +4,7 @@
a
a
a
-a
+b
a
a
a
# Line-endings: u5*suuuwuu1*tu
That's LF, 5 spaces then LF, LF, LF, CRLF, LF, LF, 1 tab then LF.
It's getting silly fast :)
Some mailers might even eat leading white space, although I think it's
defensible to reject bundles that have corrupt leading ws.
cheers
--
Michael Ellerman
IBM OzLabs
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060614/4c6e255c/attachment.pgp
More information about the bazaar
mailing list