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

Re: change the filetype from binary to text after the file is commited to a git repo

From
Ttonka3100@gmail.com <tonka3100@gmail.com>
Date
Jul 24, 2017, 20:34 UTC
Message-ID
<1C78174C-36D7-44B6-92A9-8A77D12AC6D2@gmail.com>
In-Reply-To
<20170724203215.nnktj55xyvqfmcvj@sigill.intra.peff.net>
Thx jeff, i will try it tomorrow.
Show 23 quoted lines
> Am 24.07.2017 um 22:32 schrieb Jeff King <peff@peff.net>:
> 
> On Mon, Jul 24, 2017 at 10:26:22PM +0200, tonka3100@gmail.com wrote:
> 
>>> I'm not sure exactly what you're trying to accomplish. If you're unhappy
>>> with the file as utf-16, then you should probably convert to utf-8 as a
>>> single commit (since the diff will otherwise be unreadable) and then
>>> make further changes in utf-8.
> 
>> That was exactly what i'm searching for. The utf-16 back in the days
>> was by accident (thx to visual studio). So if the last commit and the
>> acutal change are both utf-8 the diff should work again.  Just for my
>> understanding. Git just take the bytes of the whole file on every
>> commit, so there is no general problem with that, the size of the
>> utf-16 is just twice as big as the utf-8 one, is that correct?
> 
> Right. The diff switching the encodings will be listed as "binary" (and
> you should write a good commit message explaining what's going on!), but
> then after that the changes to the utf-8 version will display as normal
> text.  Git only looks at the actual bytes being diffed, not older
> versions of the file.
> 
> -Peff
Previous: Jeff King
Message 6 of 6 in “change the filetype from binary to text after the file is commited to a git repo”
  1. tonka tonkaJul 24, 2017
  2. Jeff KingJul 24, 2017
  3. tonka3100@gmail.comJul 24, 2017
  4. Jeff KingJul 24, 2017
  5. Jeff KingJul 24, 2017
  6. tonka3100@gmail.comJul 24, 2017

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.