git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Victor Engmark <victorengmark@catalyst.net.nz>
To: Git Mailing List <git@vger.kernel.org>
Subject: Re: Cannot negate `*` ignore pattern for directory with space in the name
Date: Wed, 19 Sep 2018 09:03:12 +1200	[thread overview]
Message-ID: <4af0a71a-4b25-f09c-b238-3264e7a49058@catalyst.net.nz> (raw)
In-Reply-To: <CACsJy8Cbp+1-CXMup4m=qLgJA511X0NtM51sFma_8nmp4_EhKg@mail.gmail.com>

On 19/09/2018 05:59, Duy Nguyen wrote:
> On Tue, Sep 18, 2018 at 6:13 AM Victor Engmark
> <victorengmark@catalyst.net.nz> wrote:
[…]
>> $ cat > .gitignore << EOF
>>> *
>>> !foo bar
>>> !foo\ bar
>>> !"foo bar"
> 
> No need to quote, either with double quotes or backslashes. They are
> interpreted as literal " and \

Thanks! I just tried a bunch of things to see if anything stuck.

>> $ git status --short
>> [no output]
> 
> It's not exactly a bug, more like a trap. '*' matches anything, at
> every level. So even if you negate 'foo bar', when we check 'foo
> bar/test', '*' pattern applies again and ignores 'foo bar/test'. If
> the first line in .gitignore is /* instead of * (to keep match
> anything at the top level directory only), then it should work.

You're right, I've managed to induce the placebo effect in myself :)
Thank you for the help, and sorry for the noise!

-- 
Cheers
Victor

      reply	other threads:[~2018-09-18 21:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18  4:03 Cannot negate `*` ignore pattern for directory with space in the name Victor Engmark
2018-09-18 17:59 ` Duy Nguyen
2018-09-18 21:03   ` Victor Engmark [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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4af0a71a-4b25-f09c-b238-3264e7a49058@catalyst.net.nz \
    --to=victorengmark@catalyst.net.nz \
    --cc=git@vger.kernel.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).