From: Petr Baudis Date: Wed, 27 Apr 2005 17:30:59 GMT Subject: Re: git add / update-cache --add fails. Message-ID: <20050427173059.GE22956@pasky.ji.cz> In-Reply-To: <87ll74go7o.fsf@coraid.com> Dear diary, on Wed, Apr 27, 2005 at 06:48:43PM CEST, I got a letter where Ed L Cashin told me that... > Herbert Xu writes: > > > Rhys Hardwick wrote: > >> > >> rhys@metatron:~/repo/learning.repo$ strace update-cache --add w1d4p1.c > > ... > >> open("w1d4p1.c", O_RDONLY) = -1 ENOENT (No such file or > >> directory) > > > > The file that you're trying to add doesn't exist. > > Maybe the user should be informed as soon as update-cache knows that? > > update-cache.c: 11388582a830a6161d1c769aa8616bed6f593b8a > --- a/update-cache.c > +++ b/update-cache.c > @@ -98,6 +98,7 @@ static int add_file_to_cache(char *path) > > fd = open(path, O_RDONLY); > if (fd < 0) { > + fprintf(stderr, "update-cache Error: %s\n", strerror(errno)); > if (errno == ENOENT) { > if (allow_remove) > return remove_file_from_cache(path); FWIW, I have this in my tree for some time already. :-) > By the way, I created that patch with "git diff" in my git-pasky > working directory. Strangely, I had to redirect standard error to the > same place as standard output in order to get the filename in the diff > output. I didn't check why the filename is on standard error, > though. Interesting. Anyway, you are apparently using some quite antique git-pasky version. -- Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor