git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git 1.7.10.msysgit.1: different behaviour in ".gitignore" and ".git/info/exclude"
@ 2012-05-30  8:43 Thomas Wichern
  2012-05-30 10:28 ` Johannes Sixt
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Wichern @ 2012-05-30  8:43 UTC (permalink / raw)
  To: git-mailing

Hi,

I noticed the following difference when using the pattern "/(*)/"
(ignore all directories where the name is enclosed in parenthesis)

If you have a ".gitignore" - file that contains the pattern "/(*)/", a
directory that matches the pattern is ignored completely.

If you put the same pattern into the ".git/info/exclude" - file, the
pattern does not work - these directories still show up.

I expected that all directories anywhere the repository that match the
pattern to be ignored.

Am I doing something wrong? Is the pattern not correct?

Horrido,
Thomas

---
git version 1.7.10.msysgit.1
Windows 7 Pro

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git 1.7.10.msysgit.1: different behaviour in ".gitignore" and ".git/info/exclude"
  2012-05-30  8:43 git 1.7.10.msysgit.1: different behaviour in ".gitignore" and ".git/info/exclude" Thomas Wichern
@ 2012-05-30 10:28 ` Johannes Sixt
  2012-05-30 10:52   ` Thomas Wichern
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Sixt @ 2012-05-30 10:28 UTC (permalink / raw)
  To: Thomas Wichern; +Cc: git-mailing

Am 5/30/2012 10:43, schrieb Thomas Wichern:
> If you have a ".gitignore" - file that contains the pattern "/(*)/", a
> directory that matches the pattern is ignored completely.
> 
> If you put the same pattern into the ".git/info/exclude" - file, the
> pattern does not work - these directories still show up.
> 
> I expected that all directories anywhere the repository that match the
> pattern to be ignored.

The first slash in the pattern means: Match only in this directory, not in
subdirectories. For patterns in .git/info/exclude, "this directory" is the
top-level of the repository.

> Am I doing something wrong? Is the pattern not correct?

Perhaps you need "(*)/", i.e., without the first slash.

-- Hannes

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git 1.7.10.msysgit.1: different behaviour in ".gitignore" and ".git/info/exclude"
  2012-05-30 10:28 ` Johannes Sixt
@ 2012-05-30 10:52   ` Thomas Wichern
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Wichern @ 2012-05-30 10:52 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: git-mailing

Hi Hannes,

thanks a lot - it was my fault and you're right.
It works with "(*)/" very well!

Horrido,
Thomas


> Am 5/30/2012 10:43, schrieb Thomas Wichern:
>> If you have a ".gitignore" - file that contains the pattern "/(*)/", a
>> directory that matches the pattern is ignored completely.
>> 
>> If you put the same pattern into the ".git/info/exclude" - file, the
>> pattern does not work - these directories still show up.
>> 
>> I expected that all directories anywhere the repository that match the
>> pattern to be ignored.

> The first slash in the pattern means: Match only in this directory, not in
> subdirectories. For patterns in .git/info/exclude, "this directory" is the
> top-level of the repository.

>> Am I doing something wrong? Is the pattern not correct?

> Perhaps you need "(*)/", i.e., without the first slash.

> -- Hannes

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-30 10:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-30  8:43 git 1.7.10.msysgit.1: different behaviour in ".gitignore" and ".git/info/exclude" Thomas Wichern
2012-05-30 10:28 ` Johannes Sixt
2012-05-30 10:52   ` Thomas Wichern

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).