From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: Re: remove CR/LF from .gitignore
Date: Wed, 02 Nov 2005 12:27:06 -0800 [thread overview]
Message-ID: <7v1x1yssmd.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0511020759500.27915@g5.osdl.org> (Linus Torvalds's message of "Wed, 2 Nov 2005 08:02:03 -0800 (PST)")
Linus Torvalds <torvalds@osdl.org> writes:
> On Wed, 2 Nov 2005, Alex Riesen wrote:
>>
>> For everyone cursed by dos/windows line endings (aka CRLF):
>
> Btw, it would be good if somebody verified that the .git/config file also
> works with CR/LF.
>
> I'm pretty sure "\" at the end of line will break, but I didn't care
> enough. And maybe nobody does. Normal config files _should_ work, but
> you can guess how eager I'm to test it ;)
Something like this?
---
cd /opt/packrat/playpen/public/in-place/git/git.junio/
git diff
diff --git a/config.c b/config.c
index 519fecf..e89bab2 100644
--- a/config.c
+++ b/config.c
@@ -13,6 +13,14 @@ static int get_next_char(void)
c = '\n';
if ((f = config_file) != NULL) {
c = fgetc(f);
+ if (c == '\r') {
+ /* DOS like systems */
+ c = fgetc(f);
+ if (c != '\n') {
+ ungetc(c, f);
+ c = '\r';
+ }
+ }
if (c == '\n')
config_linenr++;
if (c == EOF) {
Compilation finished at Wed Nov 2 12:24:27
prev parent reply other threads:[~2005-11-02 20:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-02 13:05 remove CR/LF from .gitignore Alex Riesen
2005-11-02 16:02 ` Linus Torvalds
2005-11-02 20:27 ` Junio C Hamano [this message]
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=7v1x1yssmd.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=torvalds@osdl.org \
/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