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

Re: [RFC/PATCH v3 2/3] sha1_file: prepare for adding alternates on demand

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 22, 2009, 23:43 UTC
Message-ID
<alpine.DEB.1.00.0901230041500.3586@pacific.mpi-cbg.de>
In-Reply-To
<1232659071-14401-3-git-send-email-hjemli@gmail.com>
Hi,
On Thu, 22 Jan 2009, Lars Hjemli wrote:
Show 27 quoted lines
> @@ -285,9 +286,10 @@ static int link_alt_odb_entry(const char * entry, int len, const char * relative
>  
>  	/* Detect cases where alternate disappeared */
>  	if (!is_directory(ent->base)) {
> -		error("object directory %s does not exist; "
> -		      "check .git/objects/info/alternates.",
> -		      ent->base);
> +		if (!quiet)
> +			error("object directory %s does not exist; "
> +			      "check .git/objects/info/alternates.",
> +			      ent->base);
>  		free(ent);
>  		return -1;
>  	}
> [...]
> @@ -2573,3 +2579,11 @@ int read_pack_header(int fd, struct pack_header *header)
>  		return PH_ERROR_PROTOCOL;
>  	return 0;
>  }
> +
> +int add_alt_odb(char *path, int quiet)
> +{
> +	int err = link_alt_odb_entry(path, strlen(path), NULL, 0, quiet);
> +	if (!err)
> +		prepare_packed_git_one(path, 0);
> +	return err;
> +}

FWIW my concern is not at all addressed. A future user of add_alt_odb() (and possibly your users in rare cases, too) can trigger the error that suggests looking into the alternates. Leaving the human user puzzled.

Ciao, Dscho

Previous: Lars HjemliNext: Lars Hjemli
Message 17 of 19 in “Add support for `git archive --submodules`”
  1. 0/3 Add support for `git archive --submodules`Lars Hjemli, Jan 22, 2009
  2. 1/3 tree.c: teach read_tree_recursive how to traverse gitlink entriesLars Hjemli, Jan 22, 2009
  3. 2/3 sha1_file: prepare for adding alternates on demandLars Hjemli, Jan 22, 2009
  4. 3/3 archive.c: add basic support for submodulesLars Hjemli, Jan 22, 2009
  5. Johannes SchindelinJan 22, 2009
  6. Lars HjemliJan 23, 2009
  7. Junio C HamanoJan 23, 2009
  8. Lars HjemliJan 23, 2009
  9. Junio C HamanoJan 23, 2009
  10. Lars HjemliJan 23, 2009
  11. Johannes SchindelinJan 23, 2009
  12. Lars HjemliJan 24, 2009
  13. Johannes SchindelinJan 24, 2009
  14. Lars HjemliJan 24, 2009
  15. Johannes SchindelinJan 24, 2009
  16. Lars HjemliJan 24, 2009
  17. Johannes SchindelinJan 22, 2009
  18. Lars HjemliJan 23, 2009
  19. Johannes SchindelinJan 23, 2009

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.