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

Re: gitignore excludes too much

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Jan 13, 2009, 17:36 UTC
Message-ID
<496CD118.7000302@drmicha.warpmail.net>
In-Reply-To
<alpine.LSU.2.00.0901131429020.23531@fbirervta.pbzchgretzou.qr>
Jan Engelhardt venit, vidit, dixit 01/13/09 14:30:
Show 7 quoted lines
> Hi,
> 
> 
> I noticed that having "*.d" in .gitignore ignores files that would start 
> with a dot, such as ".main.o.d". This is against Unix shell behavior;
> but maybe it's a feature rather than a bug?
> In case of latter, please fix :-)

git uses fnmatch with the last option (flags) being either 0 (for most purposes) or FNM_PATHNAME (leading /), but never with FNM_PERIOD.

Think "sh with dotglob set" ;)

Since dotfiles tend to be the ones which are not tracked this behaviour is the more practical one (compared to using FNM_PERIOD and forcing the typical user to write two patterns).

Cheers, Michael

Previous: Jan Engelhardt
Message 2 of 2 in “gitignore excludes too much”
  1. Jan EngelhardtJan 13, 2009
  2. Michael J GruberJan 13, 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.