From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.5 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 6E4481F453 for ; Sun, 4 Nov 2018 17:07:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729054AbeKECXJ (ORCPT ); Sun, 4 Nov 2018 21:23:09 -0500 Received: from mout.web.de ([212.227.15.4]:37747 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728858AbeKECXJ (ORCPT ); Sun, 4 Nov 2018 21:23:09 -0500 Received: from localhost ([195.198.252.176]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MPp0k-1gEPv11dMg-0050rI; Sun, 04 Nov 2018 18:07:29 +0100 Received: from localhost ([195.198.252.176]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MPp0k-1gEPv11dMg-0050rI; Sun, 04 Nov 2018 18:07:29 +0100 Date: Sun, 4 Nov 2018 18:07:29 +0100 From: Torsten =?iso-8859-1?Q?B=F6gershausen?= To: =?iso-8859-1?Q?Adri=E1n?= Gimeno Balaguer Cc: git@vger.kernel.org Subject: Re: git-rebase is ignoring working-tree-encoding Message-ID: <20181104170729.GA21372@tor.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-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SUdHd9lGu/YH7t obrThQnF1S+OWs6MLb7A7Tc4Kpe9w== Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, Nov 02, 2018 at 03:30:17AM +0100, Adrián Gimeno Balaguer wrote: > I’m attempting to perform fixups via git-rebase of UTF-16 LE files > (the project I’m working on requires that exact encoding on certain > files). When the rebase is complete, Git changes that file’s encoding > to UTF-16 BE. I have been using the newer working-tree-encoding > attribute in .gitattributes. I’m using Git for Windows. > > $ git version > git version 2.19.1.windows.1 > > Here is a sample UTF-16 LE file (with BOM and LF endings) with > following atributes in .gitattributes: > > test.txt eol=lf -text working-tree-encoding=UTF-16 > > I put eol=lf and -text to tell Git to not change the encoding of the > file on checkout, but that doesn’t even help. Asides, the newer > working-tree-encoding allows me to view human-readable diffs of that > file (in GitHub Desktop and Git Bash). Now, note that doing for > example consecutive commits to the same file does not affect the > UTF-16 LE encoding. And before I discovered this attribute, the whole > thing was even worse when squash/fixup rebasing, as Git would modify > the file with Chinese characters (when manually setting it as text via > .gitattributes). > > So, again the problem with the exposed .gitattributes line is that > after fixup rebasing, UTF-16 LE files encoding change to UTF-16 BE. > > For long, I have been working with the involved UTF-16 LE files set as > binary via .gitattributes (e.g. “test.txt binary”), so that Git would > not modify the file encoding, but this doesn’t allow me to view the > diffs upon changes in GitHub Desktop, which I want (and neither via > git diff). Thanks for the report. I have tried to follow the problem from your verbal descriptions (and the PR) but I need to admit that I don't fully understand the problem (yet). Could you try to create some instructions how to reproduce it? A numer of shell istructions would be great, in best case some kind of "test case", like the tests in the t/ directory in Git. It would be nice to be able to re-produce it. And if there is a bug, to get it fixed.