All of lore.kernel.org
 help / color / mirror / Atom feed
From: Finn Arne Gangstad <finnag@pvv.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH] Support \ in non-wildcard .gitignore entries
Date: Tue, 10 Feb 2009 13:58:00 +0100	[thread overview]
Message-ID: <20090210125800.GA14800@pvv.org> (raw)
In-Reply-To: <alpine.DEB.1.00.0902101354460.10279@pacific.mpi-cbg.de>

On Tue, Feb 10, 2009 at 01:56:36PM +0100, Johannes Schindelin wrote:
> Hi,
> 
> On Tue, 10 Feb 2009, Finn Arne Gangstad wrote:
> 
> > If you had an exclude-pattern with a backslash in it, e.g. "\#foo",
> > this would not work, since git would do a strcmp of the exclude pattern
> > and the filename. Only wildcard patterns were matched with fnmatch,
> > which does the right thing with backslashes. We now also treat all patterns
> > containing backslashes as wildcards.
> > 
> > De-escaping the pattern while reading the .gitignore file is error prone,
> > since that would break patterns with both backslashes and wildcards.
> > E.g. "\\*.c" would be translated to "\*.c" before fnmatch got it,
> > and would change the meaning of the rule dramatically.
> 
> I am not sure I understand (maybe a test case would help, but that test 
> case would have to be disabled on Windows, I guess):
> 
> You mean that '\#abc' would match '\#abc', but '\#abc*' would not?

Currently, \#abc does not match a file named #abc, but \#abc* does.
With the patch, both will match.

- Finn Arne

  reply	other threads:[~2009-02-10 12:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-10 12:11 [PATCH] Support \ in non-wildcard .gitignore entries Finn Arne Gangstad
2009-02-10 12:56 ` Johannes Schindelin
2009-02-10 12:58   ` Finn Arne Gangstad [this message]
2009-02-10 13:02     ` Johannes Schindelin
2009-02-10 14:20       ` [PATCH v2] Support "\" in non-wildcard exclusion entries Finn Arne Gangstad
2009-02-10 14:27         ` Johannes Schindelin
2009-02-10 14:37           ` Finn Arne Gangstad
2009-02-10 15:24             ` Junio C Hamano
2009-02-10 16:41               ` Junio C Hamano
2009-02-10 17:23                 ` Finn Arne Gangstad
2009-02-12  9:32                 ` [PATCH v3] " Finn Arne Gangstad
2009-02-12 10:44                   ` Johannes Schindelin
2009-02-12 21:03                     ` Junio C Hamano

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

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

  git send-email \
    --in-reply-to=20090210125800.GA14800@pvv.org \
    --to=finnag@pvv.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.