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

Re: [PATCHv2 9/9] cache.h: allow oid_object_info to handle arbitrary repositories

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Apr 24, 2018, 22:49 UTC
Message-ID
<20180424154911.54ab50bc2f95bc92ef88350a@google.com>
In-Reply-To
<20180424215910.22201-10-sbeller@google.com>

On Tue, 24 Apr 2018 14:59:09 -0700 Stefan Beller <sbeller@google.com> wrote:

> This involves also adapting oid_object_info_extended and a some
> internal functions that are used to implement these. It all has to
> happen in one patch, because of a single recursive chain of calls visits
> all these functions.

I wrote about delta_base_cache in a reply [1] to an earlier version, which is indeed safe (as discussed), but I think that other reviewers might have questions about that too so I think it's worth noting that in the commit message. Maybe write something like:

  Among the functions modified to handle arbitrary repositories,
  unpack_entry() is one of them. Note that it still references the
  globals "delta_base_cache" and "delta_base_cached", but those are safe
  to be referenced (the former is indexed partly by "struct packed_git
  *", which is repo-specific, and the latter is only used to limit the
  size of the former as an optimization).
[1] https://public-inbox.org/git/20180424112332.38c0d04d96689f030e96825a@google.com/
Show 5 quoted lines
> sha1_object_info_extended is also used in partial clones, which allow
> fetching missing objects. As this series will not add the repository
> struct to the transport code and fetch_object(), add a TODO note and
> bug out if a user tries to use a partial clone in a repository other than
> the_repository.
s/sha1_object/oid_object/ (in the 2nd paragraph)
Also, you sent 2 versions of PATCHv2 9/9.
  
Show 14 quoted lines
> @@ -1290,9 +1291,12 @@ int oid_object_info_extended_the_repository(const struct object_id *oid, struct
>  		if (fetch_if_missing && repository_format_partial_clone &&
>  		    !already_retried) {
>  			/*
> -			 * TODO Investigate haveing fetch_object() return
> +			 * TODO Investigate having fetch_object() return
>  			 * TODO error/success and stopping the music here.
> +			 * TODO Pass a repository struct through fetch_object.
>  			 */
> +			if (r != the_repository)
> +				die(_("partial clones only supported in the_repository"));
>  			fetch_object(repository_format_partial_clone, real->hash);
>  			already_retried = 1;
>  			continue;

This most likely means that a partial clone with a submodule would wrongly error out here. Instead, the "r == the_repository" check should be done in the same "if" statement as repository_format_partial_clone (and no "die"-ing occurs if it fails - just that there will be no fetching of objects).

Previous: Stefan BellerNext: Stefan Beller
Message 8 of 24 in “[PATCHv2 0/9] object store: oid_object_info is the next contender”
  1. Stefan BellerApr 24, 2018
  2. 1/9 cache.h: add repository argument to oid_object_info_extendedStefan Beller, Apr 24, 2018
  3. 2/9 cache.h: add repository argument to oid_object_infoStefan Beller, Apr 24, 2018
  4. 3/9 packfile: add repository argument to retry_bad_packed_offsetStefan Beller, Apr 24, 2018
  5. 4/9 packfile: add repository argument to packed_to_object_typeStefan Beller, Apr 24, 2018
  6. 5/9 packfile: add repository argument to packed_object_infoStefan Beller, Apr 24, 2018
  7. 9/9 cache.h: allow oid_object_info to handle arbitrary repositoriesStefan Beller, Apr 24, 2018
  8. Jonathan TanApr 24, 2018
  9. 8/9 packfile: add repository argument to cache_or_unpack_entryStefan Beller, Apr 24, 2018
  10. 7/9 packfile: add repository argument to unpack_entryStefan Beller, Apr 24, 2018
  11. 6/9 packfile: add repository argument to read_objectStefan Beller, Apr 24, 2018
  12. 9/9 cache.h: allow sha1_object_info to handle arbitrary repositoriesStefan Beller, Apr 24, 2018
  13. 0/9 object store: oid_object_info is the next contenderStefan Beller, Apr 25, 2018
  14. 1/9 cache.h: add repository argument to oid_object_info_extendedStefan Beller, Apr 25, 2018
  15. 3/9 packfile: add repository argument to retry_bad_packed_offsetStefan Beller, Apr 25, 2018
  16. 6/9 packfile: add repository argument to read_objectStefan Beller, Apr 25, 2018
  17. 9/9 cache.h: allow oid_object_info to handle arbitrary repositoriesStefan Beller, Apr 25, 2018
  18. 2/9 cache.h: add repository argument to oid_object_infoStefan Beller, Apr 25, 2018
  19. 5/9 packfile: add repository argument to packed_object_infoStefan Beller, Apr 25, 2018
  20. 4/9 packfile: add repository argument to packed_to_object_typeStefan Beller, Apr 25, 2018
  21. 8/9 packfile: add repository argument to cache_or_unpack_entryStefan Beller, Apr 25, 2018
  22. 7/9 packfile: add repository argument to unpack_entryStefan Beller, Apr 25, 2018
  23. Jonathan TanApr 25, 2018
  24. Brandon WilliamsApr 26, 2018

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.