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

Re: How do I qualify paths in the .gitignore file w.r.t. the repo root directory?

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 26, 2009, 17:04 UTC
Message-ID
<7v1vtluo2e.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<slrngqc47n.t1k.sitaramc@sitaramc.homelinux.net>
Sitaram Chamarty <sitaramc@gmail.com> writes:
Show 16 quoted lines
> How about this:
>
> ----8<----
>
>     - an optional leading ! symbol meaning "unignore paths
>       that match this pattern, instead of ignoring them"
>
>     - an optional trailing / symbol meaning "this pattern
>       matches only with a directory (i.e., files and
>       symlinks won't match)"
>
>     - the above two symbols (if present) are then removed.
>       What remains is treated as a normal shell glob
>       pattern, with the additional restriction that if the
>       pattern still contains a slash, it matches only at the
>       current directory and not in its subdirectories

Sure, but then you are not stripping the leading / from the pattern but you do not use it for the purpose of matching, right?

I think your original before I wondered about the ambiguity is the best rewrite so far.

Previous: Sitaram ChamartyNext: Brent Goodrick
Message 13 of 15 in “How do I qualify paths in the .gitignore file w.r.t. the repo root directory?”
  1. Brent GoodrickFeb 24, 2009
  2. Junio C HamanoFeb 24, 2009
  3. Sitaram ChamartyFeb 24, 2009
  4. Junio C HamanoFeb 24, 2009
  5. Sitaram ChamartyFeb 24, 2009
  6. Sitaram ChamartyFeb 25, 2009
  7. Junio C HamanoFeb 25, 2009
  8. Sitaram ChamartyFeb 25, 2009
  9. Junio C HamanoFeb 25, 2009
  10. Björn SteinbrinkFeb 26, 2009
  11. Sitaram ChamartyFeb 26, 2009
  12. Sitaram ChamartyFeb 26, 2009
  13. Junio C HamanoFeb 26, 2009
  14. Brent GoodrickFeb 25, 2009
  15. Sitaram ChamartyFeb 25, 2009

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.