git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: "Yue Lin Ho" <yuelinho777@gmail.com>,
	"Torsten Bögershausen" <tboegi@web.de>
Cc: git@vger.kernel.org, msysGit <msysgit@googlegroups.com>
Subject: Re: [msysGit] Re: The different EOL behavior between libgit2-based software and official Git
Date: Fri, 20 Jun 2014 12:33:16 +0200	[thread overview]
Message-ID: <53A40DEC.4050902@web.de> (raw)
In-Reply-To: <CAO_ghTLq-a3dJGXvmspaCYS19RhTJzT0teWO5XSfVSiRUN7rrQ@mail.gmail.com>


> ​Wow!
> 
> P.S.
> libgit2 just has a PR that try to be identical with official git.
> See https://github.com/libgit2/libgit2/pull/2432
> 
> Yue Lin Ho 
> 

I am not sure how much problems Git/libgit2 have with files contains mixed LF-CRLF,
as I have the same problem with the LF.txt

The handling, according to my understandig, is:
When core.eol is CRLF (or native under Windows) and core.autocrlf is true, and a file
is checked out:
  If a file has CRLF in one line in the repo, nothing is changed.
  If a file has LF in one line in the repo, LF is converted into CRLF in the workspace.

But here at my systems this doesn't seem to work as expected either for LF.txt:

tb@mac:~/EOL_Test/TestAutoCrlf>  t=LF.txt  &&  rm -f $t &&  git -c core.eol=CRLF checkout $t  && od -c  $t
0000000    L   i   n   e       1  \r  \n   l   i   n   e       (   2   )
0000020   \r  \n   l   i   n   e       3   .  \r  \n   t   h   i   s    
0000040    i   s       l   i   n   e       4  \r  \n   l       i       n
0000060        e       N   o   .       5  \r  \n   L   i   n   e       N
0000100    u   m   b   e   r       6  \r  \n  \r  \n                    
==================
tb@Linux:~/EOL_Test/TestAutoCrlf$ t=LF.txt  &&  rm -f $t &&  git -c core.eol=CRLF checkout $t  && od -c  $t
0000000   L   i   n   e       1  \n   l   i   n   e       (   2   )  \n
0000020   l   i   n   e       3   .  \n   t   h   i   s       i   s    
0000040   l   i   n   e       4  \n   l       i       n       e       N
0000060   o   .       5  \n   L   i   n   e       N   u   m   b   e   r
0000100       6  \n  \n

  reply	other threads:[~2014-06-20 10:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-19  2:59 The different EOL behavior between libgit2-based software and official Git Yue Lin Ho
2014-06-19  6:39 ` Torsten Bögershausen
2014-06-19  7:25   ` Yue Lin Ho
2014-06-20  6:56   ` Torsten Bögershausen
2014-06-20  8:30     ` Yue Lin Ho
2014-06-20 10:33       ` Torsten Bögershausen [this message]
2014-06-20 16:33         ` Junio C Hamano
2014-06-22  6:46           ` [msysGit] " Torsten Bögershausen
2014-06-23 17:29             ` Junio C Hamano
2014-06-20  8:44     ` Yue Lin Ho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53A40DEC.4050902@web.de \
    --to=tboegi@web.de \
    --cc=git@vger.kernel.org \
    --cc=msysgit@googlegroups.com \
    --cc=yuelinho777@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).