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

Re: [PATCH v7 0/7] convert: add support for different encodings

From
Jeff King <peff@peff.net>
Date
Mar 1, 2018, 07:49 UTC
Message-ID
<20180301074918.GG31079@sigill.intra.peff.net>
In-Reply-To
<xmqqfu5lm2nw.fsf@gitster-ct.c.googlers.com>
On Wed, Feb 28, 2018 at 09:42:27AM -0800, Junio C Hamano wrote:
Show 20 quoted lines
> > I also think we'd want a plan for this to be used consistently in other
> > diff-like tools. E.g., "git blame" uses textconv for the starting file
> > content, and it would be nice for this to kick in then, too. Ditto for
> > things like grep, pickaxe, etc.
> 
> You probably do not want to limit your thinking to the generation
> side.  It is entirely plausible to have "we deal with diff in this
> encoding X" in addition to "the in-repo encoding for this project is
> this encoding Y" and "the working tree encoding for this path is Z"
> and allow them to interact in "git diff | git apply" pipeline.
> 
> "diff/format-patch --stdout/etc." on the upstream would first iconv
> Y to X and feed the contents in X to xdiff machinery, which is sent
> down the pipe and received by apply, which reads the preimage from
> the disk or from the repository.  If doing "apply" without
> "--cached/--index", the preimage data from the disk would go through
> iconv Z to X.  If doing "apply --cached/--index", the preimage data
> from the repo would go through iconv Y to X.  The incoming patch is
> in X, so we apply, and the resulting postimage will be re-encoded in
> Z in the working tree and Y in the repository.

I agree that would be convenient, but I have to wonder if all the complexity is worth it to maintain the idea of a distinct in-repo representation. It seems like it would open up a ton of corner cases. And I suspect most people would be happy enough with either a clean/smudge style worktree conversion or a textconv-style view.

So if somebody wants to work on it, I don't want to stop them. But I think there's room for the simpler solutions in the meantime.

-Peff
Previous: Junio C HamanoNext: Torsten Bögershausen
Message 38 of 41 in “convert: add support for different encodings”
  1. 0/7 convert: add support for different encodingslars.schneider@autodesk.com, Feb 15, 2018
  2. 6/7 convert: add tracing for 'working-tree-encoding' attributelars.schneider@autodesk.com, Feb 15, 2018
  3. 7/7 convert: add round trip check based on 'core.checkRoundtripEncoding'lars.schneider@autodesk.com, Feb 15, 2018
  4. 5/7 convert: add 'working-tree-encoding' attributelars.schneider@autodesk.com, Feb 15, 2018
  5. 3/7 utf8: add function to detect prohibited UTF-16/32 BOMlars.schneider@autodesk.com, Feb 15, 2018
  6. 4/7 utf8: add function to detect a missing UTF-16/32 BOMlars.schneider@autodesk.com, Feb 15, 2018
  7. 2/7 strbuf: add xstrdup_toupper()lars.schneider@autodesk.com, Feb 15, 2018
  8. 1/7 strbuf: remove unnecessary NUL assignment in xstrdup_tolower()lars.schneider@autodesk.com, Feb 15, 2018
  9. Ævar Arnfjörð BjarmasonFeb 16, 2018
  10. Jeff KingFeb 16, 2018
  11. Junio C HamanoFeb 16, 2018
  12. Junio C HamanoFeb 15, 2018
  13. Jeff KingFeb 15, 2018
  14. Junio C HamanoFeb 16, 2018
  15. Jeff KingFeb 16, 2018
  16. Jeff KingFeb 16, 2018
  17. Junio C HamanoFeb 16, 2018
  18. Lars SchneiderFeb 21, 2018
  19. Lars SchneiderFeb 16, 2018
  20. Torsten BögershausenFeb 16, 2018
  21. Lars SchneiderFeb 22, 2018
  22. Jeff KingFeb 22, 2018
  23. Junio C HamanoFeb 23, 2018
  24. Junio C HamanoFeb 23, 2018
  25. Lars SchneiderFeb 24, 2018
  26. Jeff KingFeb 26, 2018
  27. Torsten BögershausenFeb 26, 2018
  28. Jeff KingFeb 26, 2018
  29. Torsten BögershausenFeb 27, 2018
  30. Jeff KingFeb 27, 2018
  31. Junio C HamanoFeb 27, 2018
  32. Jeff KingFeb 27, 2018
  33. Junio C HamanoFeb 27, 2018
  34. Jeff KingFeb 27, 2018
  35. Torsten BögershausenFeb 28, 2018
  36. Jeff KingFeb 28, 2018
  37. Junio C HamanoFeb 28, 2018
  38. Jeff KingMar 1, 2018
  39. Torsten BögershausenMar 4, 2018
  40. Lars SchneiderFeb 28, 2018
  41. Junio C HamanoFeb 16, 2018

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.