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

Re: [PATCH 4/4] Only re-encode certain parts in commit object, not the whole

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Feb 22, 2012, 02:01 UTC
Message-ID
<CACsJy8BZixyzf73TGPdf+_=rz59J4GWUq8B8WXuf+n97-OF=sQ@mail.gmail.com>
In-Reply-To
<20120221182559.GB32668@sigill.intra.peff.net>
2012/2/22 Jeff King <peff@peff.net>:
Show 17 quoted lines
> On Tue, Feb 21, 2012 at 09:24:52PM +0700, Nguyen Thai Ngoc Duy wrote:
>
>> Commit object has its own format, which happens to be in ascii, but
>> not really subject to re-encoding.
>>
>> There are only four areas that may be re-encoded: author line,
>> committer line, mergetag lines and commit body.  Encoding of tags
>> embedded in mergetag lines is not decided by commit encoding, so leave
>> it out and consider it binary.
>
> Is this worth the effort? Yes, re-encoding the ASCII bits of the commit
> object is unnecessary. But do we actually handle encodings that are not
> ASCII supersets? IOW, I could see the point if this is making it
> possible to hold utf-16 names and messages in your commits (though why
> you would want to do so is beyond me...). But my understanding is that
> this is horribly broken anyway by other parts of the code. And even
> looking at your code below:

No, utf-16 and friends are out of question. 617/1168 supported encodings in iconv translate chars 10,32-126 to something else, some of them does not generate NUL. I suppose none of these are actually used nowadays. Looking again, some don't even successfully translate the given input. No, it's probably not worth the effort.

-- 
Duy
Previous: Jeff KingNext: Junio C Hamano
Message 11 of 12 in “t3900: add missing UTF-16.txt and mark the test successful”
  1. 1/4 t3900: add missing UTF-16.txt and mark the test successfulNguyễn Thái Ngọc Duy, Feb 21, 2012
  2. 2/4 Do attempt pretty print in ASCII-incompatible encodingsNguyễn Thái Ngọc Duy, Feb 21, 2012
  3. Nguyen Thai Ngoc DuyFeb 21, 2012
  4. Jeff KingFeb 21, 2012
  5. Nguyen Thai Ngoc DuyFeb 22, 2012
  6. Peter KreftingFeb 23, 2012
  7. 3/4 utf8: die if failed to re-encodingNguyễn Thái Ngọc Duy, Feb 21, 2012
  8. Junio C HamanoFeb 21, 2012
  9. 4/4 Only re-encode certain parts in commit object, not the wholeNguyễn Thái Ngọc Duy, Feb 21, 2012
  10. Jeff KingFeb 21, 2012
  11. Nguyen Thai Ngoc DuyFeb 22, 2012
  12. Junio C HamanoFeb 22, 2012

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.