From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?P=C4=93teris_K=C4=BCavi=C5=86=C5=A1?= Subject: Re: Bug in EOL conversion? Date: Wed, 23 Jan 2013 15:04:38 -0800 (PST) Message-ID: <97b95a2c-1c51-48b9-aff7-33af35b4f049@googlegroups.com> References: <063ABD39C46D492391698E400A7D1FA9@PhilipOakley> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_727_28829220.1358982279029" Cc: Stefan Norgren , git@vger.kernel.org, Philip Oakley To: msysgit@googlegroups.com X-From: msysgit+bncBC76BK4LQMIBBCGZQGEAKGQEJWUPY4Q@googlegroups.com Thu Jan 24 00:05:03 2013 Return-path: Envelope-to: gcvm-msysgit@m.gmane.org Received: from mail-vc0-f188.google.com ([209.85.220.188]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ty9NM-0008Nq-4l for gcvm-msysgit@m.gmane.org; Thu, 24 Jan 2013 00:05:00 +0100 Received: by mail-vc0-f188.google.com with SMTP id p16sf552312vcq.5 for ; Wed, 23 Jan 2013 15:04:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=x-received:x-beenthere:x-received:date:from:to:cc:message-id :in-reply-to:references:subject:mime-version:x-original-sender :precedence:mailing-list:list-id:x-google-group-id:list-post :list-help:list-archive:sender:list-subscribe:list-unsubscribe :content-type; bh=9Hwb45DT97VF0B9rJgc9wJtIIGaNs+i2X0k3w+nB1pQ=; b=bs1mCqG3k9fWOBU5NVRKpmusU6bPEmbzSWg9+dKX5HGqbu8heYKxNQwDBKhQkELY3D 8KjJJHghhKUZacSTNhsdDCnbmwCBe+JuNQD98AIZr5+DUg086v1uiN3eApUt9HT57SuC 0QFfVglplZfNB5SeON0J4/iCvvDISwf1hdSOWzjYTB2iVn3HJRjlQnsT5FBJ0/jZxBXU scrWsLEADAQ0AGCc3hAJ8bJKJMzu7aJQfkNT8tnbxTNZ0uF8M3A/OGhwn4MrnW1+vkBG 2eM8djUTseZF6S2Rhiymw1qYqfoJHf64yvkybxDSTnvPUUIcMNQnNc19u/MzGKlU56F9 oAAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:x-beenthere:x-received:date:from:to:cc:message-id :in-reply-to:references:subject:mime-version:x-original-sender :precedence:mailing-list:list-id:x-google-group-id:list-post :list-help:list-archive:sender:list-subscribe:list-unsubscribe :content-type; bh=9Hwb45DT97VF0B9rJgc9wJtIIGaNs+i2X0k3w+nB1pQ=; b=u2TpWbIzIOya+Bd+3IJFG10NHHk6s6Q43LwQPMq7oTve7nyeHlcJ0jakD/KFt6bPAr 2UqV0vTkTgOjhNgepIJORfbKtXIcmlhUcchentOlxluwpew8n3fKnJTyBSrrOLssXyd2 aWAoitXhO3PUNubXzdaIn4HtQa8wsyNPf61+SwEXjbNBlwRFJWsu22Z+AzWTzY4icZ2e 5L7ARuLSm/oIzBlzNaQpcNvknu1EuWwVVH4GCDeFnPZqXUVOAN9lGax9pok60tA1pXTp HTZ7DWLhxXP2Zq11f7lZV6Qbe0ZjixsD3zw6NWDGsoqb3lmyJzq7QYXxg9vxXpwhH7vg JjvA== X-Received: by 10.50.217.201 with SMTP id pa9mr18570igc.17.1358982281270; Wed, 23 Jan 2013 15:04:41 -0800 (PST) X-BeenThere: msysgit@googlegroups.com Received: by 10.50.108.197 with SMTP id hm5ls379385igb.7.gmail; Wed, 23 Jan 2013 15:04:39 -0800 (PST) X-Received: by 10.50.191.131 with SMTP id gy3mr34231igc.1.1358982279508; Wed, 23 Jan 2013 15:04:39 -0800 (PST) In-Reply-To: <063ABD39C46D492391698E400A7D1FA9@PhilipOakley> X-Original-Sender: p.klavins@gmail.com Precedence: list Mailing-list: list msysgit@googlegroups.com; contact msysgit+owners@googlegroups.com List-ID: X-Google-Group-Id: 152234828034 List-Post: , List-Help: , List-Archive: Sender: msysgit@googlegroups.com List-Subscribe: , List-Unsubscribe: , Archived-At: ------=_Part_727_28829220.1358982279029 Content-Type: text/plain; charset=ISO-8859-1 Hi Philip You are mis-reading the warning. Git is acting as it does for the recommended settings for Windows. The 'repository' under the .git directory ALWAYS contains files with LF-only endings (unless you desperately override the settings). The warning was telling you that when you were checking in the file, it found that you have 'abnormal' line endings (for Windows) in the file in your checkout (just LF endings) and so tried to be helpful in saying that if someone else were to check the file out from your repository on Windows, they would get CRLF in the file on checkout. But the warning says 'the file will be checked in with CRLF' or similar because you are not supposed to know that the repository actually strips the CR and stores the file with LF-only. As you found out when you deleted the file and checked out a fresh copy, Git DID give you a copy of the file with CRLF endings, as how it said it had stored it in the repository! This translation between CRLF on disk and LF-only in the repository is done so that the same set of files would have the same repository contents, regardless of whether they were originally created on Windows or Linux. On Windows, files are normally created WITH CRLF endings, and on Linux with LF-only endings. In both cases, the same otherwise identical files would have identical, LF-only, copies in the actual repository in the .git directory. Peter On Wednesday, 23 January 2013 21:55:13 UTC, Philip Oakley wrote: > > The msysgit list msy...@googlegroups.com may be a better > place for > this. > > It is likely that you have a windows specific EOL conversion set within > the wider config's (i.e. --system, --global). You may have > core.safecrlf set which does a round trip test so tests the conversion > both ways. > > The normal canonical line ending choice is LF in the repo. > > I don't have a W7 install to compare against. > > Philip > > ----- Original Message ----- > From: "Stefan Norgren" > > To: > > Sent: Wednesday, January 23, 2013 2:44 AM > Subject: Bug in EOL conversion? > > > > Hi, > > > > The EOL conversion does not behave as indicated by output message from > > add and commit. Here is my test case executed on Windows 7 64 bit. > > > > > > $ git --version > > git version 1.8.0.msysgit.0 > > $ which git > > /cygdrive/c/Program Files (x86)/Git/cmd/git > > $ git config --list > > core.symlinks=false > > core.autocrlf=true > > color.diff=auto > > color.status=auto > > color.branch=auto > > color.interactive=true > > pack.packsizelimit=2g > > help.format=html > > http.sslcainfo=/bin/curl-ca-bundle.crt > > sendemail.smtpserver=/bin/msmtp.exe > > diff.astextplain.textconv=astextplain > > rebase.autosquash=true > > user.name=Stefan > > user.email=stefan@---.com > > core.repositoryformatversion=0 > > core.filemode=false > > core.bare=false > > core.logallrefupdates=true > > core.symlinks=false > > core.ignorecase=true > > core.hidedotfiles=dotGitOnly > > > > -- Note core.autocrlf=true. > > -- Created withcrlf.txt with one character and one CRLF line feed. > > File size 3 bytes. > > -- Created withlf.txt with one character and one LF line feed. File > > size 2 bytes. > > -- Now let's init repository. > > > > $ git init > > Initialized empty Git repository in D:/Dev/workspaces/gittest/.git/ > > $ ls -la > > total 10 > > d---------+ 1 Stefan None 0 Jan 23 02:12 . > > d---------+ 1 Stefan None 0 Jan 23 02:10 .. > > d---------+ 1 Stefan None 0 Jan 23 02:13 .git > > ----------+ 1 Stefan None 3 Jan 23 01:55 withcrlf.txt > > ----------+ 1 Stefan None 2 Jan 23 01:55 withlf.txt > > > > -- Note no .gitattributes file that will affect EOL conversion. > > > > $ ls -la .git/info/ > > total 5 > > d---------+ 1 Stefan None 0 Jan 23 02:12 . > > d---------+ 1 Stefan None 0 Jan 23 02:13 .. > > ----------+ 1 Stefan None 240 Jan 23 02:12 exclude > > > > -- Note no attribute file in .git/info/ that will affect EOL > > conversion. > > > > $ git add * > > warning: LF will be replaced by CRLF in withlf.txt. > > The file will have its original line endings in your working > > directory. > > $ git commit -m 'Testing EOL' > > [master (root-commit) 9a0b2f5] Testing EOL > > 2 files changed, 2 insertions(+) > > create mode 100644 withcrlf.txt > > create mode 100644 withlf.txt > > warning: LF will be replaced by CRLF in withlf.txt. > > The file will have its original line endings in your working > > directory. > > $ ls -la > > total 10 > > d---------+ 1 Stefan None 0 Jan 23 02:12 . > > d---------+ 1 Stefan None 0 Jan 23 02:10 .. > > d---------+ 1 Stefan None 0 Jan 23 02:22 .git > > ----------+ 1 Stefan None 3 Jan 23 01:55 withcrlf.txt > > ----------+ 1 Stefan None 2 Jan 23 01:55 withlf.txt > > > > -- So no changes (see file size) to files in working directory. This > > is expected and according to output warning from add and commit. > > > > -- Now lets look in the repository > > > > $ git ls-tree -l HEAD withcrlf.txt > > 100644 blob d00491fd7e5bb6fa28c517a0bb32b8b506539d4d 2 > > withcrlf.txt > > $ git ls-tree -l HEAD withlf.txt > > 100644 blob d00491fd7e5bb6fa28c517a0bb32b8b506539d4d 2 > > withlf.txt > > > > -- Note that size of withlf.txt is 2 in repository indicating that LF > > was not replaced by CRLF in withlf.txt as indicated in output from add > > and commit. Also note that size of withcrlf.txt is also 2 in > > repository so it looks like CRLF was replaced by LF in withcrlf.txt. > > To verify I will delete the files from working directory, turn off EOL > > conversion, checkout files and look at file endings in the working > > directory. > > > > $ rm with* > > $ ls -la > > total 8 > > d---------+ 1 Stefan None 0 Jan 23 02:31 . > > d---------+ 1 Stefan None 0 Jan 23 02:10 .. > > d---------+ 1 Stefan None 0 Jan 23 02:22 .git > > $ git status > > # On branch master > > # Changes not staged for commit: > > # (use "git add/rm ..." to update what will be committed) > > # (use "git checkout -- ..." to discard changes in working > > directory) > > # > > # deleted: withcrlf.txt > > # deleted: withlf.txt > > # > > no changes added to commit (use "git add" and/or "git commit -a") > > $ git config --global core.autocrlf false > > $ git config --global core.autocrlf > > false > > $ git checkout -- with* > > $ ls -la > > total 10 > > d---------+ 1 Stefan None 0 Jan 23 02:38 . > > d---------+ 1 Stefan None 0 Jan 23 02:10 .. > > d---------+ 1 Stefan None 0 Jan 23 02:38 .git > > ----------+ 1 Stefan None 2 Jan 23 02:38 withcrlf.txt > > ----------+ 1 Stefan None 2 Jan 23 02:38 withlf.txt > > > > -- Both files in working directory files now have LF line endings > > confirming that files in repository have LF file endings. Either the > > output message of add and commit is wrong or the behavior of the EOL > > conversion is wrong... or... have I missed something...? > > > > /Stefan > > -- > > To unsubscribe from this list: send the line "unsubscribe git" in > > the body of a message to majo...@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > > > > > ----- > > No virus found in this message. > > Checked by AVG - www.avg.com > > Version: 2013.0.2890 / Virus Database: 2639/6050 - Release Date: > > 01/22/13 > > > > -- *** Please reply-to-all at all times *** *** (do not pretend to know who is subscribed and who is not) *** *** Please avoid top-posting. *** The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free. You received this message because you are subscribed to the Google Groups "msysGit" group. To post to this group, send email to msysgit@googlegroups.com To unsubscribe from this group, send email to msysgit+unsubscribe@googlegroups.com For more options, and view previous threads, visit this group at http://groups.google.com/group/msysgit?hl=en_US?hl=en ------=_Part_727_28829220.1358982279029 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Philip

You are mis-reading the warning. Git is acting= as it does for the recommended settings for Windows. The 'repository' unde= r the .git directory ALWAYS contains files with LF-only endings (unless you= desperately override the settings). The warning was telling you that when = you were checking in the file, it found that you have 'abnormal' line endin= gs (for Windows) in the file in your checkout (just LF endings) and so trie= d to be helpful in saying that if someone else were to check the file out f= rom your repository on Windows, they would get CRLF in the file on checkout= . But the warning says 'the file will be checked in with CRLF' or similar b= ecause you are not supposed to know that the repository actually strips the= CR and stores the file with LF-only. As you found out when you deleted the= file and checked out a fresh copy, Git DID give you a copy of the file wit= h CRLF endings, as how it said it had stored it in the repository! This tra= nslation between CRLF on disk and LF-only in the repository is done so that= the same set of files would have the same repository contents, regardless = of whether they were originally created on Windows or Linux. On Windows, fi= les are normally created WITH CRLF endings, and on Linux with LF-only endin= gs. In both cases, the same otherwise identical files would have identical,= LF-only, copies in the actual repository in the .git directory.
=
Peter

On Wednesday, 23 January 2013 21:55:13 UTC, Phi= lip Oakley wrote:
The msysgit = list msy...@googlegroups.com may be a better place for=20
this.

It is likely that you have a windows specific EOL conversion set within= =20
the wider config's (i.e.  --system, --global). You may have=20
core.safecrlf set which does a round trip test so tests the conversion= =20
both ways.

The normal canonical line ending choice is LF in the repo.

I don't have a W7 install to compare against.

Philip

----- Original Message -----=20
From: "Stefan Norgren" <stefan....@gmail.com>
To: <g...@vger.kernel.org>
Sent: Wednesday, January 23, 2013 2:44 AM
Subject: Bug in EOL conversion?


> Hi,
>
> The EOL conversion does not behave as indicated by output message = from
> add and commit. Here is my test case executed on Windows 7 64 bit.
>
>
> $ git --version
> git version 1.8.0.msysgit.0
> $ which git
> /cygdrive/c/Program Files (x86)/Git/cmd/git
> $ git config --list
> core.symlinks=3Dfalse
> core.autocrlf=3Dtrue
> color.diff=3Dauto
> color.status=3Dauto
> color.branch=3Dauto
> color.interactive=3Dtrue
> pack.packsizelimit=3D2g
> help.format=3Dhtml
> http.sslcainfo=3D/bin/curl-ca-bundle.crt
> sendemail.smtpserver=3D/bin/msmtp.exe
> diff.astextplain.textconv=3Dastextplain
> rebase.autosquash=3Dtrue
> user.name=3DSte= fan
> user.email=3Dstefan@---.com
> core.repositoryformatversion=3D0
> core.filemode=3Dfalse
> core.bare=3Dfalse
> core.logallrefupdates=3Dtrue
> core.symlinks=3Dfalse
> core.ignorecase=3Dtrue
> core.hidedotfiles=3DdotGitOnly
>
> -- Note core.autocrlf=3Dtrue.
> -- Created withcrlf.txt with one character and one CRLF line feed.
> File size 3 bytes.
> -- Created withlf.txt with one character and one LF line feed. Fil= e
> size 2 bytes.
> -- Now let's init repository.
>
> $ git init
> Initialized empty Git repository in D:/Dev/workspaces/gittest/.git/
> $ ls -la
> total 10
> d---------+ 1 Stefan None 0 Jan 23 02:12 .
> d---------+ 1 Stefan None 0 Jan 23 02:10 ..
> d---------+ 1 Stefan None 0 Jan 23 02:13 .git
> ----------+ 1 Stefan None 3 Jan 23 01:55 withcrlf.txt
> ----------+ 1 Stefan None 2 Jan 23 01:55 withlf.txt
>
> -- Note no .gitattributes file that will affect EOL conversion.
>
> $ ls -la .git/info/
> total 5
> d---------+ 1 Stefan None   0 Jan 23 02:12 .
> d---------+ 1 Stefan None   0 Jan 23 02:13 ..
> ----------+ 1 Stefan None 240 Jan 23 02:12 exclude
>
> -- Note no attribute file in .git/info/ that will affect EOL=20
> conversion.
>
> $ git add *
> warning: LF will be replaced by CRLF in withlf.txt.
> The file will have its original line endings in your working=20
> directory.
> $ git commit -m 'Testing EOL'
> [master (root-commit) 9a0b2f5] Testing EOL
> 2 files changed, 2 insertions(+)
> create mode 100644 withcrlf.txt
> create mode 100644 withlf.txt
> warning: LF will be replaced by CRLF in withlf.txt.
> The file will have its original line endings in your working=20
> directory.
> $ ls -la
> total 10
> d---------+ 1 Stefan None 0 Jan 23 02:12 .
> d---------+ 1 Stefan None 0 Jan 23 02:10 ..
> d---------+ 1 Stefan None 0 Jan 23 02:22 .git
> ----------+ 1 Stefan None 3 Jan 23 01:55 withcrlf.txt
> ----------+ 1 Stefan None 2 Jan 23 01:55 withlf.txt
>
> -- So no changes (see file size) to files in working directory. Th= is
> is expected and according to output warning from add and commit.
>
> -- Now lets look in the repository
>
> $ git ls-tree -l HEAD withcrlf.txt
> 100644 blob d00491fd7e5bb6fa28c517a0bb32b8b506539d4d   &= nbsp;   2=20
> withcrlf.txt
> $ git ls-tree -l HEAD withlf.txt
> 100644 blob d00491fd7e5bb6fa28c517a0bb32b8b506539d4d   &= nbsp;   2=20
> withlf.txt
>
> -- Note that size of withlf.txt is 2 in repository indicating that= LF
> was not replaced by CRLF in withlf.txt as indicated in output from= add
> and commit. Also note that size of withcrlf.txt is also 2 in
> repository so it looks like CRLF was replaced by LF in withcrlf.tx= t.
> To verify I will delete the files from working directory, turn off= EOL
> conversion, checkout files and look at file endings in the working
> directory.
>
> $ rm with*
> $ ls -la
> total 8
> d---------+ 1 Stefan None 0 Jan 23 02:31 .
> d---------+ 1 Stefan None 0 Jan 23 02:10 ..
> d---------+ 1 Stefan None 0 Jan 23 02:22 .git
> $ git status
> # On branch master
> # Changes not staged for commit:
> #   (use "git add/rm <file>..." to update what will be = committed)
> #   (use "git checkout -- <file>..." to discard changes= in working=20
> directory)
> #
> #       deleted:    withcrlf.txt
> #       deleted:    withlf.txt
> #
> no changes added to commit (use "git add" and/or "git commit -a")
> $ git config --global core.autocrlf false
> $ git config --global core.autocrlf
> false
> $ git checkout -- with*
> $ ls -la
> total 10
> d---------+ 1 Stefan None 0 Jan 23 02:38 .
> d---------+ 1 Stefan None 0 Jan 23 02:10 ..
> d---------+ 1 Stefan None 0 Jan 23 02:38 .git
> ----------+ 1 Stefan None 2 Jan 23 02:38 withcrlf.txt
> ----------+ 1 Stefan None 2 Jan 23 02:38 withlf.txt
>
> -- Both files in working directory files now have LF line endings
> confirming that files in repository have LF file endings. Either t= he
> output message of add and commit is wrong or the behavior of the E= OL
> conversion is wrong... or... have I missed something...?
>
>   /Stefan
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majo...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-i= nfo.html
>
>
> -----
> No virus found in this message.
> Checked by AVG - = www.avg.com
> Version: 2013.0.2890 / Virus Database: 2639/6050 - Release Date:= =20
> 01/22/13
>=20

--
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.<= br />  
You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http:= //groups.google.com/group/msysgit?hl=3Den_US?hl=3Den
------=_Part_727_28829220.1358982279029--