From: David Greaves Date: Tue, 10 May 2005 08:42:23 GMT Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir Message-ID: <428073EF.4090407@dgreaves.com> In-Reply-To: <20050510080445.GB8176@lug-owl.de> Jan-Benedict Glaw wrote: >On Tue, 2005-05-10 09:52:27 +0200, Jan-Benedict Glaw wrote: > > >>On Tue, 2005-05-10 01:17:31 -0400, Brian Gerst wrote: >> >> >>>But it can handle symlinks: >>> >>> find * -type f -o -type l -print0 | xargs -0r cg-add >>> >>> >>This won't work because the explicit OR (-o) lower precedence compared >>to the implicit AND between "-type l" and "-print0", thus this find >>command will do print0 IFF the matched entry is a symlink. Use something >>like this instead: >> >> find * \( -type f -o tyle l \) -print0 | ... >> >> > >Btw, this won't find dot files, so using "." as the path list (instead >of "*") might be wise... > > This is a good thing - git ignores dot-files. see: http://www.dgreaves.com/git/git-update-cache.html * * Files to act on. Note that files begining with *.* are discarded. This includes ./file and dir/./file. If you don't want this, then use cleaner names. The same applies to directories ending */* and paths with *//* Cogito should eventually spot and remove these since find * will obviously find files beginning with a dot in subdirectories. David --