git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-gui: Prevent double UTF-8 conversion

From
Łukasz Stelmach <l.stelmach@samsung.com>
Date
Nov 28, 2017, 10:21 UTC
Message-ID
<20171128102126.20864-1-l.stelmach@samsung.com>
In-Reply-To
<CGME20171128102138eucas1p116ae54d723bb100202fae2c1aaf5a9d8@eucas1p1.samsung.com>

Set encoding to utf-8 for file descriptors used to receive data from git commands.

With encoding on the file descriptor set to "binary" Tcl (8.6 in my case) does double conversion which breaks e.g. author name in amended commits.

For example "\305\201ukasz" (as written by git cat-file) becomes "\303\205\302\201ukasz".

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
---
 git-gui/lib/commit.tcl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

So, this is the second attempt to draw some attention to this patch, since the first one has somewhat failed.

https://marc.info/?l=git&m=150331641702091&w=2
diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl
index 83620b7cb..bcb6499a0 100644
--- a/git-gui/lib/commit.tcl
+++ b/git-gui/lib/commit.tcl
@@ -26,7 +26,7 @@ You are currently in the middle of a merge that has not been fully completed.  Y
 	set parents [list]
 	if {[catch {
 			set fd [git_read cat-file commit $curHEAD]
-			fconfigure $fd -encoding binary -translation lf
+			fconfigure $fd -encoding utf-8 -translation lf
 			# By default commits are assumed to be in utf-8
 			set enc utf-8
 			while {[gets $fd line] > 0} {
-- 
2.11.0
Next: Johannes Schindelin
Message 1 of 11 in “git-gui: Prevent double UTF-8 conversion”
  1. git-gui: Prevent double UTF-8 conversionŁukasz Stelmach, Nov 28, 2017
  2. Johannes SchindelinNov 28, 2017
  3. Łukasz StelmachDec 2, 2017
  4. git-gui: Prevent double UTF-8 conversionŁukasz Stelmach, Dec 2, 2017
  5. Johannes SchindelinDec 4, 2017
  6. git-gui: Prevent double UTF-8 conversionŁukasz Stelmach, Dec 5, 2017
  7. Johannes SchindelinDec 7, 2017
  8. git-gui: Prevent double UTF-8 conversionŁukasz Stelmach, Dec 14, 2017
  9. Eric SunshineDec 14, 2017
  10. Łukasz StelmachDec 14, 2017
  11. Eric SunshineDec 14, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.