From: Junio C Hamano <gitster@pobox.com>
To: Alexandre Garnier <zigarn@gmail.com>
Cc: git@vger.kernel.org, "Steffen Prohaska" <prohaska@zib.de>,
"Alex Riesen" <raa.lkml@gmail.com>,
"Eyvind Bernhardsen" <eyvind.bernhardsen@gmail.com>,
"Carlos Martín Nieto" <cmn@dwim.me>
Subject: Re: [BUG] Git does not convert CRLF=>LF on files with \r not before \n
Date: Tue, 21 Apr 2015 10:41:01 -0700 [thread overview]
Message-ID: <xmqq1tjdidle.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAFFOgCUTxnbL7vJpf1Hw39CJL_p2raDZ2a3DehhYhdbkVyi2fw@mail.gmail.com> (Alexandre Garnier's message of "Tue, 21 Apr 2015 15:51:34 +0200")
Alexandre Garnier <zigarn@gmail.com> writes:
> echo '* text=auto' > .gitattributes
> git add .gitattributes
> git commit -q -m "Normalize EOL"
> echo -ne 'some content\r\nother \rcontent with CR\r\ncontent\r\nagain
With text=auto, the user instructs us to guess, and we expect either
LF or CRLF line-terminated files that is *TEXT*. A lone CR in the
middle of the line would mean we cannot reliably guess---it may be
LF terminated file with CRs sprinkled inside text, some of which
happen to be at the end of the line, or it may be CRLF terminated
file with CRs sprinkled in. We try to preserve the user input by
not munging when we are not sure.
You are seeing the designed and intended behaviour.
But it would be a bug if the same thing happens when the user
explicitly tells us that the file has CRLF line endings, and I
suspect we have that bug, which may want to be corrected.
I've Cc'ed various people who worked on convert.c around line
endings. I recall we saw a few other discussion threads on
text=auto and eol settings. Stakeholders may want to have a unified
discussion to first list the issues in the current implementation
and come up with fixes for them.
Thanks.
next prev parent reply other threads:[~2015-04-21 17:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-21 13:51 [BUG] Git does not convert CRLF=>LF on files with \r not before \n Alexandre Garnier
2015-04-21 17:41 ` Junio C Hamano [this message]
2015-04-21 19:28 ` Torsten Bögershausen
2015-04-22 13:06 ` Alexandre Garnier
2015-04-22 17:42 ` Junio C Hamano
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=xmqq1tjdidle.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=cmn@dwim.me \
--cc=eyvind.bernhardsen@gmail.com \
--cc=git@vger.kernel.org \
--cc=prohaska@zib.de \
--cc=raa.lkml@gmail.com \
--cc=zigarn@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.