Perhaps I'm misreading the manpage, but I think this is wrong:
% mkdir base; cd base
% git init
% mkdir -p sub1/sub2
% cd sub1
% echo foo > .gitignore; echo '!sub2/foo' >> .gitignore
% touch sub2/foo
% git add sub2/foo
The following paths are ignored by one of your .gitignore files:
sub1/sub2/foo
Use -f if you really want to add them.
fatal: no files added
So sub1/sub2/foo matches the first pattern in sub1/.gitignore, but it
also matches the negated pattern '!sub2/foo' (in the same file, so
precedence isn't an issue). And the manpage says
o An optional prefix ! which negates the pattern; any matching
file excluded by a previous pattern will become included
again. If a negated pattern matches, this will override
lower precedence patterns sources.
So surely sub1/sub2/foo ought to be included again? Or is the first
line in sub1/.gitignore not "a previous pattern" in this sense?
If I move the "foo" pattern up a level, creating a .gitignore in base
just containing "foo", then sub1/sub2/foo is still regarded as
ignored, even though it surely matches the negating pattern
sub1/.gitignore, and that should be of higher precedence than the
pattern in base/.gitignore?
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
| Jesper Krogh | Re: Linux 2.6.26-rc4 |
| Borislav Petkov | 2.6.23-rc1: no setup signature found... |
| Dmitry Torokhov | 2.6.27-rc8+ - first impressions |
| Andi Kleen | Re: 2.6.27-rc1: critical thermal shutdown on thinkpad x60 |
git: | |
| Ken Pratt | pack operation is thrashing my server |
| Martin Langhoff | parsecvs repository moved... |
| Johan Herland | [PATCH 3/6] git-fsck: Do thorough verification of tag objects. |
| Nigel Magnay | crlf with git-svn driving me nuts... |
| Joaquin Herrero | ssh hangs from Ubunty Feisty 7.04 to OpenBSD |
| Marco Peereboom | Re: Real men don't attack straw men |
| Pieter Verberne | Remove escape characters from file |
| L. V. Lammert | Re: About Xen: maybe a reiterative question but .. |
| Krzysztof Oledzki | Error: an inet prefix is expected rather than "0/0". |
| Evgeniy Polyakov | [resend take 2 4/4] DST Makefile/Kconfig files. |
| Denys Fedoryshchenko | thousands of classes, e1000 TX unit hang |
| Bruce Allen | e1000 full-duplex TCP performance well below wire speed |
| USB statistics | 18 minutes ago | Linux kernel |
| Block Sub System query | 4 hours ago | Linux kernel |
| kernel module to intercept socket creation | 5 hours ago | Linux kernel |
| Image size changing during each build | 5 hours ago | Linux kernel |
| Soft lock bug | 10 hours ago | Linux kernel |
| sysctl - dynamic registration problem | 17 hours ago | Linux kernel |
| Question on swap as ramdisk partition | 19 hours ago | Linux kernel |
| serial driver xmit problem | 1 day ago | Linux kernel |
| Generic Netlink subsytem | 1 day ago | Linux kernel |
| 'Report spam filter error' page broken | 1 day ago | KernelTrap Suggestions and Feedback |
