Thread (1 message) 1 message, 1 author, 2016-06-15

Re: Ignore pattern with trailing whitespace in .gitignore is void using git 1.8.1.5

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:56:20

Thor Andreas Rognan [off-list ref] writes:
Maybe I'm doing it wrong, or maybe it's the intended behaviour,
but I find that a trailing whitespace after a pattern in .gitignore
makes the pattern void with git 1.8.1.5.
I doubt we do anything clever like that.

        $ git init
        $ touch hello.o "hello.o " "hello.o  " hello.c
        $ echo "*.o " >.gitignore
        $ git status | cat -e
        # On branch master$
        #$
        # Initial commit$
        #$
        # Untracked files:$
        #   (use "git add <file>..." to include in what will be committed)$
        #$
        #       .gitignore$
        #       hello.c$
        #       hello.o$
        #       hello.o  $
        nothing added to commit but untracked files present (use "git add" to track)$
        
The user tells to ignore anything followed by a dot followed by a
lowercase Oh followed by a SP.  We ignore "hello. ", but not "hello.o"
nor "hello.o  " (two SPs at the end), just as told.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help