git-gui: Handle commit encoding better.
commit59885273c337df937430b8731633c2e9020ce8e3
authorShawn O. Pearce <spearce@spearce.org>
Tue, 23 Jan 2007 09:40:21 +0000 (23 04:40 -0500)
committerShawn O. Pearce <spearce@spearce.org>
Tue, 23 Jan 2007 09:40:21 +0000 (23 04:40 -0500)
treeedcb71f9c1af3315e53bdd173ce7e01bb3d176c6
parent51a989ba5a4d1299d08ddad19c6a45485bdb7dd8
git-gui: Handle commit encoding better.

Git prefers that all log messages are encoding in UTF-8.  So now when
git-gui generates the commit message it converts the commit message
text from the internal Tcl Unicode representation into a UTF-8 file.
The file is then fed as stdin to git-commit-tree.  I had to start
using a file here rather than feeding the message in with << as
<< uses the system encoding, which we may not want.

When we reload a commit message via git-cat-file we are getting the
raw byte stream, with no encoding performed by Git itself.  So unless
the new 'encoding' header appears in the message we should probably
assume it is utf-8 encoded; but if the header is present we need to
use whatever it claims.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui.sh