git@vger.kernel.org mailing list mirror (one of many)
 help / Atom feed
From: Jonathan Tan <jonathantanmy@google.com>
To: Stefan Beller <sbeller@google.com>
Cc: git@vger.kernel.org, gitster@pobox.com, bmwill@google.com,
	sandals@crustytoothpaste.net,
	Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: [PATCHv2 9/9] cache.h: allow oid_object_info to handle arbitrary repositories
Date: Tue, 24 Apr 2018 15:49:11 -0700
Message-ID: <20180424154911.54ab50bc2f95bc92ef88350a@google.com> (raw)
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/

> 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.
  
> @@ -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).

  reply index

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-24 21:59 [PATCHv2 0/9] object store: oid_object_info is the next contender Stefan Beller
2018-04-24 21:59 ` [PATCHv2 1/9] cache.h: add repository argument to oid_object_info_extended Stefan Beller
2018-04-24 21:59 ` [PATCHv2 2/9] cache.h: add repository argument to oid_object_info Stefan Beller
2018-04-24 21:59 ` [PATCHv2 3/9] packfile: add repository argument to retry_bad_packed_offset Stefan Beller
2018-04-24 21:59 ` [PATCHv2 4/9] packfile: add repository argument to packed_to_object_type Stefan Beller
2018-04-24 21:59 ` [PATCHv2 5/9] packfile: add repository argument to packed_object_info Stefan Beller
2018-04-24 21:59 ` [PATCHv2 6/9] packfile: add repository argument to read_object Stefan Beller
2018-04-24 21:59 ` [PATCHv2 7/9] packfile: add repository argument to unpack_entry Stefan Beller
2018-04-24 21:59 ` [PATCHv2 8/9] packfile: add repository argument to cache_or_unpack_entry Stefan Beller
2018-04-24 21:59 ` [PATCHv2 9/9] cache.h: allow oid_object_info to handle arbitrary repositories Stefan Beller
2018-04-24 22:49   ` Jonathan Tan [this message]
2018-04-24 21:59 ` [PATCHv2 9/9] cache.h: allow sha1_object_info " Stefan Beller
2018-04-25 18:20 ` [PATCHv3 0/9] object store: oid_object_info is the next contender Stefan Beller
2018-04-25 18:20   ` [PATCHv3 1/9] cache.h: add repository argument to oid_object_info_extended Stefan Beller
2018-04-25 18:20   ` [PATCHv3 2/9] cache.h: add repository argument to oid_object_info Stefan Beller
2018-04-25 18:21   ` [PATCHv3 3/9] packfile: add repository argument to retry_bad_packed_offset Stefan Beller
2018-04-25 18:21   ` [PATCHv3 4/9] packfile: add repository argument to packed_to_object_type Stefan Beller
2018-04-25 18:21   ` [PATCHv3 5/9] packfile: add repository argument to packed_object_info Stefan Beller
2018-04-25 18:21   ` [PATCHv3 6/9] packfile: add repository argument to read_object Stefan Beller
2018-04-25 18:21   ` [PATCHv3 7/9] packfile: add repository argument to unpack_entry Stefan Beller
2018-04-25 18:21   ` [PATCHv3 8/9] packfile: add repository argument to cache_or_unpack_entry Stefan Beller
2018-04-25 18:21   ` [PATCHv3 9/9] cache.h: allow oid_object_info to handle arbitrary repositories Stefan Beller
2018-04-25 20:37   ` [PATCHv3 0/9] object store: oid_object_info is the next contender Jonathan Tan
2018-04-26 16:30   ` Brandon Williams

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180424154911.54ab50bc2f95bc92ef88350a@google.com \
    --to=jonathantanmy@google.com \
    --cc=bmwill@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=sandals@crustytoothpaste.net \
    --cc=sbeller@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

git@vger.kernel.org mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox