git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, j6t@kdbg.org, jrnieder@gmail.com
Subject: Re: [PATCHv3 1/2] Documentation: clarify fnmatch behavior in gitignore
Date: Tue, 05 Apr 2011 16:43:33 -0600	[thread overview]
Message-ID: <4D9B9B15.8040600@redhat.com> (raw)
In-Reply-To: <7vfwpwl43h.fsf@alter.siamese.dyndns.org>

[-- Attachment #1: Type: text/plain, Size: 1579 bytes --]

On 04/05/2011 04:34 PM, Junio C Hamano wrote:
>>   - Otherwise, git treats the pattern as a shell glob suitable
>> -   for consumption by fnmatch(3) with the FNM_PATHNAME flag:
>> -   wildcards in the pattern will not match a / in the pathname.
>> -   For example, "Documentation/{asterisk}.html" matches
>> +   for consumption by fnmatch(3) with the FNM_PATHNAME but not
>> +   FNM_PERIOD flags: wildcards in the pattern will match leading
>> +   . but not / in pathnames.  For example,
> 
> Does this format correctly with asciidoc?

No idea - I'm not an asciidoc whiz.  How would I tell (or can someone
else offer some advice)?

> 
> Even if it does not get confused as a bullet or something, I think you
> would want to quote it (and the slash), perhaps like
> 
> 	`.` (dot) and `/` (slash)
> 
> In any case, I tend to think that we would want to add FNM_PERIOD to
> tighten the match in the longer term, perhaps at the 1.8.0 boundary.

POSIX requires that "find . -name '*'" not use FNM_PERIOD, and I
actually like the consistency with find(1).  In other words, I would
complain (then go with group consensus, if my complaint is in the
minority) that it is a step backwards to tighten the match, where the short:

  dir/*

would have to become the much longer

  dir/*
  dir/.[!.]
  dir/.??*

to properly exclude all except '.' and '..', or

  dir/*
  dir/.*

if '.' and '..' are already special to the pattern matching.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

  reply	other threads:[~2011-04-05 23:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-05 22:17 [PATCHv3 1/2] Documentation: clarify fnmatch behavior in gitignore Eric Blake
2011-04-05 22:17 ` [PATCHv3 2/2] Documentation: enhance gitignore whitelist example Eric Blake
2011-04-05 22:43   ` Junio C Hamano
2011-04-05 22:34 ` [PATCHv3 1/2] Documentation: clarify fnmatch behavior in gitignore Junio C Hamano
2011-04-05 22:43   ` Eric Blake [this message]
2011-04-06 12:48     ` Drew Northup

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=4D9B9B15.8040600@redhat.com \
    --to=eblake@redhat.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=jrnieder@gmail.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 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 NNTP newsgroup(s).