[MERGE][Take Four] Show the diff in the commit messages

Aaron Bentley aaron.bentley at utoronto.ca
Mon Jul 23 19:39:43 BST 2007


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

Goffredo Baroncelli wrote:
>> If we could just write the raw stream bytes to the output file, rather 
>> than doing any encoding/decoding. I'm guessing it could be done if we 
>> changed the layering. But it probably isn't as easy in the current form.
> 
> Supposing to share the diff in different environments (unicode+utf8 - 
> iso8851-15 / cp850 ), leaving the diff-body as raw-data and the filepath utf8 
> encoded may be a good compromise.
> 
> But if we use the diff in the same environment where is generated only (as the 
> diff used in the commit) and the diff is showed in a editor which is 
> _encoding_aware_ I continue to think that the we have to consider the diff 
> encoding.

I can keep on saying "diffs have no fixed encoding" as long as you like.
 Diffs are a binary format that happens to be human-readable most of the
time.

Text editors tend to be a lot smarter about handling encodings than bzr.
 It makes sense to let them handle the mishmash of encodings that diffs
may contain.

> The down side is that now the edit_commit_message() function and friends
> have to handle not only an unicode string, but also a list of strings (unicode 
> and not unicode).

I agree that it is not very nice to have a function that returns a
string, a unicode string, or a list of mixed-type strings.

If you pass an encoding into make_commit_message_template, you can turn
the status output into the correct encoding.  You can also pass the
encoding into show_diff trees, so that it can emit the paths in the
desired encoding.

That will avoid the need to return a list of strings.  (And why return a
list, when you could return two strings?)

> +The file that is opened in the editor contains a horizontal line. The part
> +of the file below this line is included for information only, and will not
> +form part of the commit message. Below the separator is shown the list of

Probably makes sense to say that the horizontal line is the separator.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGpPXv0F+nu1YWqI0RAuIsAJ4qam5yBq1dbktmFBL9ZwbCRo3cbQCfSkwG
zdGpsJflqaDejtM1y49VAxI=
=ogxC
-----END PGP SIGNATURE-----



More information about the bazaar mailing list