git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Changing encoding of a file : What should happen to CRLF in file ?
@ 2017-11-14 12:31 Ashish Negi
  2017-11-14 15:20 ` Torsten Bögershausen
                   ` (4 more replies)
  0 siblings, 5 replies; 23+ messages in thread
From: Ashish Negi @ 2017-11-14 12:31 UTC (permalink / raw)
  To: git

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.

Thanks

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2017-12-08 18:51 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-14 12:31 Changing encoding of a file : What should happen to CRLF in file ? Ashish Negi
2017-11-14 15:20 ` Torsten Bögershausen
2017-11-14 16:13   ` Ashish Negi
2017-11-14 16:15     ` Ashish Negi
2017-11-14 17:09       ` Torsten Bögershausen
2017-11-15  8:11         ` Ashish Negi
2017-11-15 17:12           ` Torsten Bögershausen
2017-11-15 19:05             ` Ashish Negi
2017-11-16 16:15               ` Torsten Bögershausen
2017-11-23 16:31                 ` Ashish Negi
2017-11-23 20:25                   ` Torsten Bögershausen
2017-11-24  6:37                     ` Ashish Negi
2017-11-14 16:45     ` Torsten Bögershausen
2017-11-24 16:14 ` [PATCH 1/1] convert: tighten the safe autocrlf handling tboegi
2017-11-24 17:24   ` Eric Sunshine
2017-11-24 18:59     ` Torsten Bögershausen
2017-11-25  3:16   ` Junio C Hamano
2017-11-26 12:20 ` [PATCH v2 " tboegi
2017-12-08 17:46 ` [PATCH v1 1/2] t0027: Don't use git commit <empty-pathspec> tboegi
2017-12-08 18:13   ` Junio C Hamano
2017-12-08 18:21     ` Junio C Hamano
2017-12-08 18:50       ` Torsten Bögershausen
2017-12-08 17:46 ` [PATCH v1 2/2] t0027: Adapt the new MIX tests to Windows tboegi

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).