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

Re: [PATCHv3 1/2] Documentation: clarify fnmatch behavior in gitignore

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 5, 2011, 22:34 UTC
Message-ID
<7vfwpwl43h.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1302041878-24426-1-git-send-email-eblake@redhat.com>
Eric Blake <eblake@redhat.com> writes:
Show 29 quoted lines
> Make it clear that in a .gitignore file,
>
>   *ignore
>
> matches (and therefore excludes) `.gitignore', even though the
> same glob does not match in the shell.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
>
> v3: separate fnmatch wording cleanup into its own patch
>
>  Documentation/gitignore.txt |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt
> index 2e7328b..9b1e5e1 100644
> --- a/Documentation/gitignore.txt
> +++ b/Documentation/gitignore.txt
> @@ -86,9 +86,10 @@ PATTERN FORMAT
>     `.gitignore` file).
>
>   - 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?

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.

Previous: Junio C HamanoNext: Eric Blake
Message 4 of 6 in “[PATCHv3 1/2] Documentation: clarify fnmatch behavior in gitignore”
  1. Eric BlakeApr 5, 2011
  2. 2/2 Documentation: enhance gitignore whitelist exampleEric Blake, Apr 5, 2011
  3. Junio C HamanoApr 5, 2011
  4. Junio C HamanoApr 5, 2011
  5. Eric BlakeApr 5, 2011
  6. Drew NorthupApr 6, 2011

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.