From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.0 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id C4F2E1F43C for ; Tue, 14 Nov 2017 15:20:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755440AbdKNPUh (ORCPT ); Tue, 14 Nov 2017 10:20:37 -0500 Received: from mout.web.de ([212.227.15.14]:54215 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755426AbdKNPUf (ORCPT ); Tue, 14 Nov 2017 10:20:35 -0500 Received: from macce.local ([195.198.252.176]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MHYLM-1eDWYP2QZw-003Ip2; Tue, 14 Nov 2017 16:20:33 +0100 Subject: Re: Changing encoding of a file : What should happen to CRLF in file ? To: Ashish Negi , git@vger.kernel.org References: From: =?UTF-8?Q?Torsten_B=c3=b6gershausen?= Message-ID: <8b3225ce-a4aa-56ee-5296-6cc7528556d1@web.de> Date: Tue, 14 Nov 2017 16:20:20 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:o5xhk4WScsCLSscB89D7SEG1t3uVq/0lvTyBn5GueU4q7hzpW+d 7KGi1qISxUjx2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Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 2017-11-14 13:31, Ashish Negi wrote: > Hello > > I have a cross platform project. I have a utf-16 file in it. > I changed its encoding to urf-8 and committed. When i pulled the file > in Linux, it shows that file is modified. This means that the commit > which changed the encoding does not convert crlf to lf, when new > format is text based (utf-8). > > Steps to reproduce: > > In windows : > > Change encoding of file from utf-16 to utf-8. > Commit the change. > > In linux: > > Pull your branch. > You will see the issue of file being shown as modified even though > you have not used it. > > > If i change the file encoding in linux and commit. Then if i do git > pull in windows, i don't see the issue. > In linux, during committing i get warning : warning: CRLF will be > replaced by LF in …file_name.. > > Here are my configuration : > > >> git config --global --get core.autocrlf > > false > > >> git config --get core.autocrlf > > false > > > >> cat E:\work\WindowsFabric\.gitattributes > > > # Set the default behavior, in case people don't have core.autocrlf set. > > * text=auto > *.vcxproj eol=crlf > *.sh eol=lf > > # Denote all files that are truly binary and should not be modified. > *.exe binary > *.dll binary > *.pdb binary > *.ico binary > *.png binary > *.jpg binary > > >> git --version > git version 2.14.2.windows.2 > > > I played around with core.autocrlf values like true and native, but > that didn't help. > > The behavior is inconsistent across platforms, and windows version is > giving me problem. > > Can someone suggest right settings for this ? Or is this a bug in Git. > I don't think it is a bug :-) What does git ls-files --eol …file_name give you under Windows ?