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

Re: [RFC/PATCH] git-gui: Use gitattribute "encoding" for file content display

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jan 24, 2008, 03:39 UTC
Message-ID
<20080124033901.GN24004@spearce.org>
In-Reply-To
<4FF40048-FCF4-4BAD-AD08-6ADAD30E7B6A@simplicidade.org>
Pedro Melo <melo@simplicidade.org> wrote:
Show 10 quoted lines
> On Jan 23, 2008, at 5:47 AM, Shawn O. Pearce wrote:
> 
> >I've got the following change in my "pu" right now and am considering
> >adding it to git-gui 0.9.2, which would be in git 1.5.4.
> 
> Spoke too soon.
> 
> I can see the UTF-8 chars in the diffs, but if I use Stage Hunk for  
> Commit in a hunk with accentuated utf-8 chars, git-gui will throw an  
> error like "patch does not apply".

Yea, I know why. It actually kept me awake for a little bit last night after I sent the patch out for comment, but wasn't big enough to get me out of bed to fix it.

The issue is git-gui doesn't convert back from character data to binary correctly, so the patch won't apply, as the context will not match. Its simple enough to fix, we just have to remember the encoding we used to go from git-diff --> Tcl and use that same encoding in the other direction (Tcl --> git-apply).

-- 
Shawn.
Previous: Pedro Melo
Message 7 of 7 in “git-gui: Use gitattribute "encoding" for file content display”
  1. git-gui: Use gitattribute "encoding" for file content displayShawn O. Pearce, Jan 23, 2008
  2. Junio C HamanoJan 23, 2008
  3. Steffen ProhaskaJan 23, 2008
  4. Jakub NarebskiJan 23, 2008
  5. Shawn O. PearceJan 24, 2008
  6. Pedro MeloJan 23, 2008
  7. Shawn O. PearceJan 24, 2008

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.