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

Re: [PATCH v1] convert: add support for 'encoding' attribute

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 14, 2017, 23:01 UTC
Message-ID
<xmqq7etosymp.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<C062CB10-9885-46B4-9614-65A39BD5FBE8@gmail.com>
Lars Schneider <larsxschneider@gmail.com> writes:
> That way you could control the encoding for a text file specific
> for each path similar to the "mode bits". That also means you could
> change the encoding of a file while the blob content stays the same.
That is exactly why I said that I doubt it makes sense.

When you have the same blob object (that is in UTF-8) appear at two places in a tree (or two different subtrees inside a single tree) and the two tree entries that point at the blob tells contradicting story, you would have a checkout of the same contents in two different encodings. If you have the same blob object appear in two adjacent commits at the same path, with one commit's tree recording its encoding differently from the other's, you would switch encodings when you switch branches. I doubt these are "features", but sources of confusion.

Be it a feature, or a misfeature, it is shared with the existing solution which is .gitattributes embedded in the tree, so you are not making anything better or worse by moving the information to tree entry.

What I actually expected to hear when somebody talks about "ideal" (which may not even be achievable given existing user base) was to make blob object declare its desired external representation. That would remove the two possible confusion cited above, because once you have a blob, you have everything needed to externalize it.

In any case, I do not think we'd go there anyway, so ...
Previous: Lars SchneiderNext: Johannes Sixt
Message 15 of 36 in “convert: add support for 'encoding' attribute”
  1. convert: add support for 'encoding' attributelars.schneider@autodesk.com, Dec 11, 2017
  2. Eric SunshineDec 11, 2017
  3. Lars SchneiderDec 11, 2017
  4. Eric SunshineDec 11, 2017
  5. Lars SchneiderDec 12, 2017
  6. Johannes SixtDec 11, 2017
  7. Lars SchneiderDec 11, 2017
  8. Junio C HamanoDec 12, 2017
  9. Johannes SixtDec 12, 2017
  10. Lars SchneiderDec 12, 2017
  11. Junio C HamanoDec 12, 2017
  12. Lars SchneiderDec 13, 2017
  13. Junio C HamanoDec 13, 2017
  14. Lars SchneiderDec 13, 2017
  15. Junio C HamanoDec 14, 2017
  16. Johannes SixtDec 12, 2017
  17. Torsten BögershausenDec 18, 2017
  18. Jeff KingDec 18, 2017
  19. Torsten BögershausenDec 23, 2017
  20. 0/2 git diff --UTF-8tboegi@web.de, Dec 29, 2017
  21. 2/2 git diff: Allow to reencode into UTF-8tboegi@web.de, Dec 29, 2017
  22. 1/2 convert_to_git(): checksafe becomes an integertboegi@web.de, Dec 29, 2017
  23. 1/1 Auto diff of UTF-16 files in UTF-8tboegi@web.de, Feb 26, 2018
  24. Peter KreftingFeb 26, 2018
  25. Jeff KingFeb 27, 2018
  26. Junio C HamanoDec 18, 2017
  27. Johannes SixtDec 18, 2017
  28. Jeff KingDec 15, 2017
  29. Lars SchneiderDec 18, 2017
  30. Jeff KingDec 18, 2017
  31. Torsten BögershausenDec 17, 2017
  32. Lars SchneiderDec 28, 2017
  33. Torsten BögershausenDec 29, 2017
  34. Lars SchneiderDec 29, 2017
  35. Junio C HamanoJan 3, 2018
  36. Lars SchneiderJan 3, 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.