git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug in .gitignore handling
@ 2008-03-26 20:01 Tommy Thorn
  2008-03-26 20:20 ` Junio C Hamano
  2008-03-26 20:27 ` Linus Torvalds
  0 siblings, 2 replies; 8+ messages in thread
From: Tommy Thorn @ 2008-03-26 20:01 UTC (permalink / raw)
  To: git

For reasons too upsetting to explain, I have to keep a collection of 
symlinks inside my tree but outside of git's control, such as

mydir/foo -> ../otherdir/foo

To stop git clean from removing it, I added "foo" to .gitignore

The problem is that I foo appears in build paths inside the tree that I 
would like git clean to pick up, however the pattern "foo" is applied 
generally and matches stuff like

mydir/mousetrap/foo/objs

According to the man page, I should be able to change .gitignore to 
"foo/" to stop it from looking recursively, but that doesn't work, as 
now git clean -n -f -d wants to remove mydir/foo but not mydir/foo/objs

My desperate attempts "./foo" and "^foo" also didn't work. Please note 
that this is a vastly simplified version of the real problem, so I can't 
just use "!mousetrap/foo".

It seems "foo/" _should_ work even though foo isn't a directory.

Thanks
Tommy

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Bug in .gitignore handling
@ 2008-03-26 20:27 Eyvind Bernhardsen
  0 siblings, 0 replies; 8+ messages in thread
From: Eyvind Bernhardsen @ 2008-03-26 20:27 UTC (permalink / raw)
  To: Tommy Thorn; +Cc: Git Mailing List

On 26. mars. 2008, at 21.01, Tommy Thorn wrote:

[...]

> According to the man page, I should be able to change .gitignore to
> "foo/" to stop it from looking recursively, but that doesn't work, as
> now git clean -n -f -d wants to remove mydir/foo but not mydir/foo/ 
> objs
>
> My desperate attempts "./foo" and "^foo" also didn't work. Please note
> that this is a vastly simplified version of the real problem, so I  
> can't
> just use "!mousetrap/foo".
>
> It seems "foo/" _should_ work even though foo isn't a directory.

Have you tried "/foo"?  That should match "foo" only in the root of  
the repository, which is what I think you're trying to do.  "foo/"  
means to only match "foo" if it is a directory.
-- 
Eyvind Bernhardsen

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

end of thread, other threads:[~2008-03-26 20:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-26 20:01 Bug in .gitignore handling Tommy Thorn
2008-03-26 20:20 ` Junio C Hamano
2008-03-26 20:26   ` Tommy Thorn
2008-03-26 20:27 ` Linus Torvalds
2008-03-26 20:32   ` Linus Torvalds
2008-03-26 20:35   ` Tommy Thorn
2008-03-26 20:49     ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2008-03-26 20:27 Eyvind Bernhardsen

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