{"thread":{"id":"2314","subject":"remove CR/LF from .gitignore","startedAt":"2005-11-02T13:05:45Z","lastAt":"2005-11-02T20:27:06Z","messageCount":3,"participants":["Alex Riesen","Linus Torvalds","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"11015","messageId":"81b0412b0511020505u1b6b7649l924e252d561b8e9e@mail.gmail.com","threadId":"2314","inReplyTo":null,"subject":"remove CR/LF from .gitignore","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2005-11-02T13:05:45Z","receivedAt":"2005-11-02T13:05:45Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"For everyone cursed by dos/windows line endings (aka CRLF):\n\nThe code reading the .gitignore files (excludes and excludes per\ndirectory) leaves \\r in the patterns, which causes fnmatch to fail for\nno obvious reason. Just remove a \"\\r\" preceding a \"\\n\"\nunconditionally.\n\n---\n\nJunio, sorry for attachments. Have no other way to it on gmail here at\nwork. The other patch is just the test.\n"},{"id":"11017","messageId":"Pine.LNX.4.64.0511020759500.27915@g5.osdl.org","threadId":"2314","inReplyTo":"81b0412b0511020505u1b6b7649l924e252d561b8e9e@mail.gmail.com","subject":"Re: remove CR/LF from .gitignore","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-11-02T16:02:03Z","receivedAt":"2005-11-02T16:02:03Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 2 Nov 2005, Alex Riesen wrote:\n>\n> For everyone cursed by dos/windows line endings (aka CRLF):\n\nBtw, it would be good if somebody verified that the .git/config file also \nworks with CR/LF. \n\nI'm pretty sure \"\\\" at the end of line will break, but I didn't care \nenough. And maybe nobody does. Normal config files _should_ work, but \nyou can guess how eager I'm to test it ;)\n\n\t\tLinus\n"},{"id":"11027","messageId":"7v1x1yssmd.fsf@assigned-by-dhcp.cox.net","threadId":"2314","inReplyTo":"Pine.LNX.4.64.0511020759500.27915@g5.osdl.org","subject":"Re: remove CR/LF from .gitignore","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-02T20:27:06Z","receivedAt":"2005-11-02T20:27:06Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@osdl.org> writes:\n\n> On Wed, 2 Nov 2005, Alex Riesen wrote:\n>>\n>> For everyone cursed by dos/windows line endings (aka CRLF):\n>\n> Btw, it would be good if somebody verified that the .git/config file also \n> works with CR/LF. \n>\n> I'm pretty sure \"\\\" at the end of line will break, but I didn't care \n> enough. And maybe nobody does. Normal config files _should_ work, but \n> you can guess how eager I'm to test it ;)\n\nSomething like this?\n\n---\ncd /opt/packrat/playpen/public/in-place/git/git.junio/\ngit diff\ndiff --git a/config.c b/config.c\nindex 519fecf..e89bab2 100644\n--- a/config.c\n+++ b/config.c\n@@ -13,6 +13,14 @@ static int get_next_char(void)\n \tc = '\\n';\n \tif ((f = config_file) != NULL) {\n \t\tc = fgetc(f);\n+\t\tif (c == '\\r') {\n+\t\t\t/* DOS like systems */\n+\t\t\tc = fgetc(f);\n+\t\t\tif (c != '\\n') {\n+\t\t\t\tungetc(c, f);\n+\t\t\t\tc = '\\r';\n+\t\t\t}\n+\t\t}\n \t\tif (c == '\\n')\n \t\t\tconfig_linenr++;\n \t\tif (c == EOF) {\n\nCompilation finished at Wed Nov  2 12:24:27\n"}]}