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

Re: [PATCH] Prevent git-upload-pack segfault if object cannot be found

From
AVAndrew Vasquez <andrew.vasquez@qlogic.com>
Date
Feb 22, 2006, 18:17 UTC
Message-ID
<20060222181758.GH3355@andrew-vasquezs-powerbook-g4-15.local>
Commit:
	b5b16990f8b074bd0481ced047b8f8bf66eee6dc
	Prevent git-upload-pack segfault if object cannot be found

is causing some really annoying noise being sent to stderr on some of my older non-packed repositories:

	$ git status
	# On branch refs/heads/b4
	unable to open object pack directory: .git/objects/pack: No such file or directory
	nothing to commit
	$ git-rev-list --pretty=oneline v8.01.04b3..
	unable to open object pack directory: .git/objects/pack: No such file or directory
	a7401b7109fb2cba7de41a0e30dfe6aa41690ea8 No ZIO.
	...
Here's the relevant hunk:
Show 16 quoted lines
> diff --git a/sha1_file.c b/sha1_file.c
> index 3d11a9b..f08b1d6 100644
> --- a/sha1_file.c
> +++ b/sha1_file.c
> @@ -551,8 +551,10 @@ static void prepare_packed_git_one(char 
>  	sprintf(path, "%s/pack", objdir);
>  	len = strlen(path);
>  	dir = opendir(path);
> -	if (!dir)
> +	if (!dir) {
> +		fprintf(stderr, "unable to open object pack directory: %s: %s\n", path, strerror(errno));
>  		return;
> +	}
>  	path[len++] = '/';
>  	while ((de = readdir(dir)) != NULL) {
>  		int namelen = strlen(de->d_name);
Could we drop this fprintf to stderr?

Thanks, Andrew

Next: Junio C Hamano
Message 1 of 8 in “Re: [PATCH] Prevent git-upload-pack segfault if object cannot be found”
  1. Andrew VasquezFeb 22, 2006
  2. Junio C HamanoFeb 22, 2006
  3. Carl WorthFeb 22, 2006
  4. Junio C HamanoFeb 22, 2006
  5. Junio C HamanoFeb 22, 2006
  6. Carl WorthFeb 22, 2006
  7. Jonas FonsecaFeb 23, 2006
  8. Give no terminating LF to error() function.Junio C Hamano, Feb 23, 2006

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.