git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 9, 2013, 05:25 UTC
Message-ID
<7vehfpf8kk.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAMn8hCexsiizsjoXO-ebfpEtZcW7n0dY-jV0q+aLh8U+pbUo9A@mail.gmail.com>
Thor Andreas Rognan <thor.rognan@gmail.com> 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.
Previous: Thor Andreas RognanNext: Junio C Hamano
Message 2 of 3 in “Ignore pattern with trailing whitespace in .gitignore is void using git 1.8.1.5”
  1. Thor Andreas RognanMar 9, 2013
  2. Junio C HamanoMar 9, 2013
  3. Junio C HamanoMar 9, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.