git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jon Simons <jon@jonsimons.org>
Cc: git@vger.kernel.org, me@ttaylorr.com, peff@peff.net,
	sunshine@sunshineco.com, stolee@gmail.com
Subject: Re: [PATCH v3 1/2] list-objects-filter: only parse sparse OID when 'have_git_dir'
Date: Fri, 30 Aug 2019 11:08:34 -0700	[thread overview]
Message-ID: <xmqqr252y199.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20190829231925.15223-2-jon@jonsimons.org> (Jon Simons's message of "Thu, 29 Aug 2019 19:19:24 -0400")

Jon Simons <jon@jonsimons.org> writes:

> diff --git a/list-objects-filter-options.c b/list-objects-filter-options.c
> index 1cb20c659c..aaba312edb 100644
> --- a/list-objects-filter-options.c
> +++ b/list-objects-filter-options.c
> @@ -71,7 +71,8 @@ static int gently_parse_list_objects_filter(
>  		 * command, but DO NOT complain if we don't have the blob or
>  		 * ref locally.
>  		 */
> -		if (!get_oid_with_context(the_repository, v0, GET_OID_BLOB,
> +		if (have_git_dir() &&
> +		    !get_oid_with_context(the_repository, v0, GET_OID_BLOB,
>  					  &sparse_oid, &oc))
>  			filter_options->sparse_oid_value = oiddup(&sparse_oid);
>  		filter_options->choice = LOFC_SPARSE_OID;

Sorry, I do not quite understand what this wants to do.  We say "we
parsed this correctly, this filter is sparse:oid=<blob>" without
filling sparse_oid_value field at all.  What do the consumers of
such a filter_options instance do to such a half-read option?

If they say "ah, the parser wanted to do sparse:oid but we couldn't
really figure the <blob> part out, so let's ignore it", that might
be the best they could do anyway, but it somewhat feels iffy.  I
wonder if we are better off inventing a new "we tried to parse but
we lack sufficient info to make it useful" value to use in .choice
field and return it instead.

In the longer term, what do we want to happen in such a case where
"read this blob to figure out what I want you to do" cannot be
satisfied due to chicken-and-egg situation like this?  Can we
postpone fetching or cloning that *wants* to use the named <blob>
when we discover that the <blob> is not available (of which, your
"!have_git_dir()" is a subset), grab that single <blob> first from
the other side before doing the main transfer, and then resume the
transfer that wants to use the <blob> after we successfully do so,
or something?

  reply	other threads:[~2019-08-30 18:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-29 23:19 [PATCH v3 0/2] partial-clone: fix two issues with sparse filter handling Jon Simons
2019-08-29 23:19 ` [PATCH v3 1/2] list-objects-filter: only parse sparse OID when 'have_git_dir' Jon Simons
2019-08-30 18:08   ` Junio C Hamano [this message]
2019-09-04  4:54     ` Jeff King
2019-09-05 18:57       ` Junio C Hamano
2019-09-09 13:54         ` Jeff Hostetler
2019-09-09 17:08           ` Jeff King
2019-09-09 20:03             ` Jeff Hostetler
2019-09-15  1:09             ` [PATCH 0/3] clone --filter=sparse:oid bugs Jeff King
2019-09-15  1:11               ` [PATCH 1/3] t5616: test cloning/fetching with sparse:oid=<oid> filter Jeff King
2019-09-15  1:13               ` [PATCH 2/3] list-objects-filter: delay parsing of sparse oid Jeff King
2019-09-15 16:12                 ` Jeff King
2019-09-17 19:22                   ` Junio C Hamano
2019-09-15  1:13               ` [PATCH 3/3] list-objects-filter: give a more specific error sparse parsing error Jeff King
2019-09-15 16:51               ` [PATCH 4/3] list-objects-filter: use empty string instead of NULL for sparse "base" Jeff King
2019-09-16 14:31               ` [PATCH 0/3] clone --filter=sparse:oid bugs Jeff Hostetler
2019-09-09 17:12           ` [PATCH v3 1/2] list-objects-filter: only parse sparse OID when 'have_git_dir' Junio C Hamano
2019-09-09 19:49             ` Jeff Hostetler
2019-08-29 23:19 ` [PATCH v3 2/2] list-objects-filter: handle unresolved sparse filter OID Jon Simons

Reply instructions:

You may reply publicly 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=xmqqr252y199.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jon@jonsimons.org \
    --cc=me@ttaylorr.com \
    --cc=peff@peff.net \
    --cc=stolee@gmail.com \
    --cc=sunshine@sunshineco.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).