Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir

From: David Greaves <[email-masked]>
Date: Tue, 10 May 2005 09:42:23 +0100

Jan-Benedict Glaw wrote:

>On Tue, 2005-05-10 09:52:27 +0200, Jan-Benedict Glaw <[email-masked]> wrote:
>  
>
>>On Tue, 2005-05-10 01:17:31 -0400, Brian Gerst <[email-masked]> 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
*
<file> *
    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

--