[PATCH] patiencediff.py/unified_diff: do not insert trailing whitespace if filedate is empty

John Arbash Meinel john at arbash-meinel.com
Tue Jan 6 14:45:57 GMT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Adeodato Simó wrote:

...

> I'd be fine with this as well, sure.
> 
> Though I believe my fix to be correct (if it ends up being applied, you
> could make it use '\t' rather than ' ' while we're at it).
> 
>> I can certainly be convinced otherwise, but since difflib.unified_diff()
>> produces the same output as our current output, I hesitate to change it.
> 
> Heh, maybe I'll propose the same patch for difflib if I get around to
> it. OTOH, if this line of yours is about /compatibility/ and not
> correctness, it's going to be more difficult to get you convinced. :-)
> 
> Thanks, John. As said, the change to DiffWriter would be fine with me if
> that's what you prefer.
> 

My #1 concern is just making sure that we emit data that can be parsed
by other people's work. At first I thought you were changing it so that
you would have:
"+++"
instead of
"+++ "


But then later I realized it was about having
"+++ filename"
instead of
"+++ filename "

Which seems a little less likely to be a compatibility problem. (Mostly
I'm concerned with "patch", but we should make sure that "bzr patch"
also does the right thing with these diffs.)

So in the end:

1) I think that DiffWriter is probably still wrong to give a trailing
whitespace warning on these lines, as the warning is meant to be about
the actual content, and not about the patch header.

2) I think I'm fine with the patch as you did it, and it would be nice
to get this sort of change also into difflib.py

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkljbqUACgkQJdeBCYSNAAMytgCdGzuv0vn6HGB/bPqdaZGXLugy
fC0AoMwcZ0Q2wkoWKiHsUsxOOjHZGlH9
=o0Ki
-----END PGP SIGNATURE-----



More information about the bazaar mailing list