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
Junio C Hamano <gitster@pobox.com>
Date
Feb 16, 2018, 19:04 UTC
Message-ID
<xmqq1shk7o2y.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<DC552BF4-3E87-41E0-BF92-4BA9633D374E@gmail.com>
Lars Schneider <larsxschneider@gmail.com> writes:
Show 14 quoted lines
>> One thing I find more problematic is that the above places *too*
>> much stress on the UTF-8 centric worldview.  It is perfectly valid
>> to store your text contents encoded in ShiftJIS and check them out
>> as-is, with or without this patch.  It is grossly misleading to say
>> that older versions of Git will check them out in UTF-8.  "will
>> checkout these files as-is without encoding conversion" is a better
>> way to say it, probably.
>
> True. But that's not what I wanted to say in the "pitfalls" section.
> If my Git client supports w-t-e and I add the ShiftJIS encoded
> file "foo.bar" to my repository, then Git will store the file as
> UTF-8 _internally_. That means if you clone my repository and your 
> Git client does _not_ support w-t-e, then you will see "foo.bar" as 
> UTF-8 encoded.

What you wrote implies *more* than that, which is what I had trouble with.

If you say "what you have is checked out as-is", then it is still clear that those who use w-t-e to convert non UTF-8 into UTF-8 when checking in will get UTF-8 out when they use an older version of Git. If you say "what you have will be checked out in UTF-8", it makes it sound as if pre w-t-e Git will somehow reject non UTF-8 in-tree contents, or magically convert anything to UTF-8 while checking out, which is *not* what you want to imply.

Show 8 quoted lines
>> Also notice that even in the world with w-t-e, such a project won't
>> benefit from w-t-e at all.  After all, they have been happy using
>> ShiftJIS in repository and using the same encoding on the working
>> tree, and because w-t-e assumes that everybody should be using UTF-8
>> internally, such a project cannot take advantage of the new
>> mechanism.
>
> Agreed. However, people using ShiftJIS are not my target audience.

Be aware that you are writing *not* *solely* for your target audience. You write document for everybody, and make sure the description of a feature makes it clear who the feature primarily targets and how using (or not using) the feature affects users.

Previous: Lars Schneider
Message 41 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.