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

Re: help request: unable to merge UTF-16-LE "text" file

From
EEErik Cervin Edin <erik@cervined.in>
Date
Apr 20, 2022, 17:55 UTC
Message-ID
<CA+JQ7M9o+kZUgLkCq7aauCUwzZy6OzwKpyGQ1DxQyaL2jkJBSg@mail.gmail.com>
In-Reply-To
<xmqq8rrzr6dp.fsf@gitster.g>
On Wed, Apr 20, 2022 at 7:50 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
>
> For that to work, it is likely that you'd need to convert not just
> the tips of two branches getting merged, but also the merge base
> commit, so that all three trees involved in the 3-way merge are in
> the same text encoding.
Hmm.. Right, the common ancestor would still be the old encoding :/
On Wed, Apr 20, 2022 at 7:38 PM Kevin Long <kevinlong206@gmail.com> wrote:
>
> Thanks, I actually did try that without success. I'm wondering if
> there is an "ancestor" object that is still binary or something, deep
> rooted in the tree.
Yes, as Junio correctly pointed out.
> Converting it once and for all to utf-8 would be great, as that will
> work fine with Visual Studio.  Not sure why the original committer
> chose UTF-16.
Visual Studio probably saved it as utf-16le with BOM :(
Show 6 quoted lines
> I have tried several "working-tree-encoding" settings in
> .gitattributes in my local working directory, to no avail yet:
>
> *.sln working-tree-encoding=UTF-16-LE eol=CRLF, results in:
> error: failed to encode 'FacilityMaster.sln' from UTF-16-LE to UTF-8
> warning: Cannot merge binary files: FacilityMaster.sln (HEAD vs. master)
Could the issue be that it should be UTF-16LE (without hyphen)?
Previous: Junio C HamanoNext: Erik Cervin Edin
Message 6 of 9 in “help request: unable to merge UTF-16-LE "text" file”
  1. Kevin LongApr 19, 2022
  2. brian m. carlsonApr 19, 2022
  3. Erik Cervin EdinApr 20, 2022
  4. Kevin LongApr 20, 2022
  5. Junio C HamanoApr 20, 2022
  6. Erik Cervin EdinApr 20, 2022
  7. Erik Cervin EdinApr 20, 2022
  8. Chris TorekApr 24, 2022
  9. Plato KiorpelidisApr 22, 2022

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.