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

Re: git clone corrupts file.

From
Jeff King <peff@peff.net>
Date
Aug 16, 2021, 18:51 UTC
Message-ID
<YRqzmC5ubd0TEWL/@coredump.intra.peff.net>
In-Reply-To
<YRqYD+SszvhhySwl@coredump.intra.peff.net>
On Mon, Aug 16, 2021 at 12:53:36PM -0400, Jeff King wrote:
Show 5 quoted lines
> But an alternative workflow, if you really want UTF-16 in the working
> tree, is to convert between UTF-8 and UTF-16 as the files go in and out
> o the working tree. There's no built-in support for that, but you could
> do it with a custom clean/smudge filter. That would let Git store UTF-8
> internally, do diffs, etc.

Oh, by the way, I totally forgot that we added an internal version of this, which is easier to configure and much more efficient. See the "working-tree-encoding" attribute in "git help attributes".

Just in case you do want to go that route.
-Peff
Previous: Russell, ScottNext: Russell, Scott
Message 8 of 13 in “git clone corrupts file.”
  1. Russell, ScottAug 13, 2021
  2. brian m. carlsonAug 13, 2021
  3. Russell, ScottAug 16, 2021
  4. Jeff KingAug 16, 2021
  5. Russell, ScottAug 16, 2021
  6. Jeff KingAug 16, 2021
  7. Russell, ScottAug 16, 2021
  8. Jeff KingAug 16, 2021
  9. Russell, ScottAug 16, 2021
  10. brian m. carlsonAug 16, 2021
  11. Russell, ScottAug 16, 2021
  12. brian m. carlsonAug 16, 2021
  13. Russell, ScottAug 16, 2021

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.