git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* `*' gitignores and nested ignores
@ 2011-03-24 10:10 Eli Barzilay
  2011-03-25  8:18 ` Johannes Sixt
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Barzilay @ 2011-03-24 10:10 UTC (permalink / raw)
  To: git

According to the man page, a .gitignore file that is deeper has higher
precedence, and a `!' line overrides lower precedence ignores.  I
tried that, and it works in cases like the last "vmlinux*" example.

But it doesn't work if the lower precedence directory has a "*"
pattern.  If the last example from the man page is changed to:

               $ cat .gitignore
               *
               $ ls arch/foo/kernel/vm*
               arch/foo/kernel/vmlinux.lds.S
               $ echo ´!/vmlinux*´ >arch/foo/kernel/.gitignore

then -- IIUC -- the second ignore should work the same, but it
doesn't.  This also happens if the first pattern is "/*".

Is this a bug?


BTW, my use case is to track random stuff in a directory that has lots
of junk.  I wanted to do this by having a toplevel "/*" ignore and add
files explicitly when I want to.  But there are some directories that
should be tracked, and I was trying to achieve this effect by adding a
"!/*" pattern in them.  Is there a more convenient (or saner) way of
doing this?

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

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

end of thread, other threads:[~2011-03-25  9:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-24 10:10 `*' gitignores and nested ignores Eli Barzilay
2011-03-25  8:18 ` Johannes Sixt
2011-03-25  9:37   ` Eli Barzilay

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