git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git add / update-cache --add fails.

From
Petr Baudis <pasky@ucw.cz>
Date
Apr 27, 2005, 17:30 UTC
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 <ecashin@coraid.com> told me that...

Show 13 quoted lines
> Herbert Xu <herbert@gondor.apana.org.au> writes:
> 
> > Rhys Hardwick <rhys@rhyshardwick.co.uk> 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?
> 
Show 11 quoted lines
> 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. :-)
Show 5 quoted lines
> 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
Previous: Ed L CashinNext: Ed L Cashin
Message 9 of 14 in “git add / update-cache --add fails.”
  1. Rhys HardwickApr 25, 2005
  2. Rhys HardwickApr 25, 2005
  3. Rhys HardwickApr 25, 2005
  4. Chris WedgwoodApr 25, 2005
  5. Linus TorvaldsApr 26, 2005
  6. Rhys HardwickApr 26, 2005
  7. Herbert XuApr 27, 2005
  8. Ed L CashinApr 27, 2005
  9. Petr BaudisApr 27, 2005
  10. Ed L CashinApr 27, 2005
  11. Paul JacksonApr 28, 2005
  12. Petr BaudisApr 28, 2005
  13. Paul JacksonApr 28, 2005
  14. Junio C HamanoApr 26, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.