git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Forcing CRLF for files in a directory
@ 2010-07-01 12:12 Ryan McCue
  2010-07-01 13:37 ` Eyvind Bernhardsen
  2010-07-01 13:55 ` Finn Arne Gangstad
  0 siblings, 2 replies; 3+ messages in thread
From: Ryan McCue @ 2010-07-01 12:12 UTC (permalink / raw)
  To: git

Hi there,

I'm working on a project at the moment which stores raw HTTP header data 
along with bodies for use during testing. As each header line must be 
separated by a CRLF, these need to remain so in the repository.

My question is: Do I need to do anything special to ensure these CRLFs 
aren't converted to LFs during checkout?

Thanks,
Ryan.

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

* Re: Forcing CRLF for files in a directory
  2010-07-01 12:12 Forcing CRLF for files in a directory Ryan McCue
@ 2010-07-01 13:37 ` Eyvind Bernhardsen
  2010-07-01 13:55 ` Finn Arne Gangstad
  1 sibling, 0 replies; 3+ messages in thread
From: Eyvind Bernhardsen @ 2010-07-01 13:37 UTC (permalink / raw)
  To: Ryan McCue; +Cc: git

On 1. juli 2010, at 14.12, Ryan McCue wrote:

> Hi there,
> 
> I'm working on a project at the moment which stores raw HTTP header data along with bodies for use during testing. As each header line must be separated by a CRLF, these need to remain so in the repository.
> 
> My question is: Do I need to do anything special to ensure these CRLFs aren't converted to LFs during checkout?

No.  As long as you don't set any attributes, git will by default leave your line endings alone on Linux.

You might get into trouble on Windows, because git defaults to converting line endings to CRLF on checkout (core.autocrlf=true) and gets confused when files are already checked in with CRLFs.  This problem is fixed in the upcoming 1.7.2 release.
-- 
Eyvind

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

* Re: Forcing CRLF for files in a directory
  2010-07-01 12:12 Forcing CRLF for files in a directory Ryan McCue
  2010-07-01 13:37 ` Eyvind Bernhardsen
@ 2010-07-01 13:55 ` Finn Arne Gangstad
  1 sibling, 0 replies; 3+ messages in thread
From: Finn Arne Gangstad @ 2010-07-01 13:55 UTC (permalink / raw)
  To: Ryan McCue; +Cc: git

On Thu, Jul 01, 2010 at 10:12:52PM +1000, Ryan McCue wrote:
> Hi there,
>
> I'm working on a project at the moment which stores raw HTTP header data  
> along with bodies for use during testing. As each header line must be  
> separated by a CRLF, these need to remain so in the repository.
>
> My question is: Do I need to do anything special to ensure these CRLFs  
> aren't converted to LFs during checkout?

If you are working on Windows and have set autocrlf (default on in
msysgit), they will be converted to LF only in the repo if they are
auto-detected as text files, and will get LF when checked out on a
system with autocrlf false.

You can force autocrlf to not think of a file as a text file by
setting "-crlf" for that file in .gitattributes.

In the upcoming 1.7.2 release, autocrlf has been fixed to never
autodetect files with mixed line endings in the repository as text
files, but it will take considerable time before that version is used
everywhere I guess. Also, this won't really help you if you create the
files on Windows.

- Finn Arne

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

end of thread, other threads:[~2010-07-01 13:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-01 12:12 Forcing CRLF for files in a directory Ryan McCue
2010-07-01 13:37 ` Eyvind Bernhardsen
2010-07-01 13:55 ` Finn Arne Gangstad

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).