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

John Arbash Meinel john at arbash-meinel.com
Thu Jul 19 21:31:16 BST 2007


John Arbash Meinel has voted +0.
Status is now: Waiting
Comment:
I realize I'm coming late to this discussion, but 'commit --show-diff' 
seems to give a closer meaning than 'commit --diff'.

+              Option('diff',
+                     help='Show the diff in the bottom of the 
editor.'),

How about:

Option('diff',
        help='When no message is supplied, show the diff along with the'
             ' status summary in the message editor.')


I would be a lot happier with:
+        # FIXME: the function show_diff_trees encode the pathname
+        #        as UTF8. The output of the 
make_commit_message_template()
+        #        function is decoded according to the user encoding.
+        #        So assuming output_encoding = user encoding
+        #         - if the output_encoding is different from
+        #        UTF8 the diff body is preserved, but the filename
+        #        may be not correct
+        #        - if we set output_encoding=UTF8 and the
+        #        output_encoding is not UTF8 we have the
+        #        filepath correct, but the diff body may be not correct
+
+        status_tmp.write(stream.getvalue().decode(output_encoding))


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.

This really seems like it is going to puke whenever you have a non-ascii 
filename modified on Windows. (well, it may not puke since the common 
encodings are all 8-bit, so the decode() will succeed, it will just give 
you garbage for the filenames).


I guess this is better than what we have...




For details, see: 
http://bundlebuggy.aaronbentley.com/request/%3C200707171923.56476.kreijack%40tiscalinet.it%3E



More information about the bazaar mailing list