threads / discuss / 17145

gitignore excludes too much

Subject: gitignore excludes too much

## tl;dr

2 messages between Jan 13, 2009 and Jan 13, 2009.

replies: 1people: 2as markdown or json

Jan Engelhardt· Jan 13, 2009, 13:30 UTC · lore
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 :-)

Jan
Michael J Gruber· Jan 13, 2009, 17:36 UTC · re: Jan Engelhardt · lore

Re: gitignore excludes too much

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

← back to recent threads