Subject: Re: update-cache ./test.c

From: David Greaves <[email-masked]>
Date: Sun, 01 May 2005 10:43:34 +0100

Lennert Buytenhek wrote:

>Hi,
>
>update-cache seems to ignore paths containing path components
>starting with a dot:
>
>	pi% update-cache --add ./test.c
>	Ignoring path ./test.c
>	pi% update-cache --add test.c
>	pi%
>
>This is slightly annoying as 'find -type f | xargs update-cache --add'
>doesn't work because of this.  ('find * -type f | ...` does.)  Instead
>of ignoring the file, can we just strip off the leading "./"
>  
>

This is documented behaviour:
<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 '//'

"Where?" you ask...

Well, Linus hasn't accepted the docs for some reason - you have to
search the archives...

Sorry about that...

David
PS Changing this behaviour was discussed and dismissed for the core tools.
If the problem appears in Cogito however, then it's worth patching...