* remove CR/LF from .gitignore
@ 2005-11-02 13:05 Alex Riesen
2005-11-02 16:02 ` Linus Torvalds
0 siblings, 1 reply; 3+ messages in thread
From: Alex Riesen @ 2005-11-02 13:05 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
[-- Attachment #1: Type: text/plain, Size: 397 bytes --]
For everyone cursed by dos/windows line endings (aka CRLF):
The code reading the .gitignore files (excludes and excludes per
directory) leaves \r in the patterns, which causes fnmatch to fail for
no obvious reason. Just remove a "\r" preceding a "\n"
unconditionally.
---
Junio, sorry for attachments. Have no other way to it on gmail here at
work. The other patch is just the test.
[-- Attachment #2: msdos-excludes.patch --]
[-- Type: application/xxxxx, Size: 401 bytes --]
[-- Attachment #3: msdos-excludes-test.patch --]
[-- Type: application/xxxxx, Size: 648 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: remove CR/LF from .gitignore
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
0 siblings, 1 reply; 3+ messages in thread
From: Linus Torvalds @ 2005-11-02 16:02 UTC (permalink / raw)
To: Alex Riesen; +Cc: git, Junio C Hamano
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 ;)
Linus
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: remove CR/LF from .gitignore
2005-11-02 16:02 ` Linus Torvalds
@ 2005-11-02 20:27 ` Junio C Hamano
0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2005-11-02 20:27 UTC (permalink / raw)
To: Linus Torvalds; +Cc: git
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-11-02 20:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox