git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jonathan Tan <jonathantanmy@google.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] send-pack: never fetch when checking exclusions
Date: Tue, 08 Oct 2019 13:10:17 +0900	[thread overview]
Message-ID: <xmqqzhibnahi.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20191007213839.233451-1-jonathantanmy@google.com> (Jonathan Tan's message of "Mon, 7 Oct 2019 14:38:39 -0700")

Jonathan Tan <jonathantanmy@google.com> writes:

> When building the packfile to be sent, send_pack() is given a list of
> remote refs to be used as exclusions. For each ref, it first checks if
> the ref exists locally, and if it does, passes it with a "^" prefix to
> pack-objects. However, in a partial clone, the check may trigger a lazy
> fetch. Ensure that this lazy fetch does not occur.

Is there any effect worth describing here, other than the obvious
"we do not lazily fetch from within the has_object_file() function"?

For example, would this change mean that the resulting pack may
include stuff that are reachable from the (missing) negative objects
that would not otherwise have to be sent if these objects were
available (or made available by the lazy fetching), and we are
making a trade-off to send possibly more in order for not fetching?
Have we laid enough on the table to help readers if such a trade-off
(if we are making one, that is) strikes the right balance?

Thanks.

> Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
> ---
>  send-pack.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/send-pack.c b/send-pack.c
> index 6dc16c3211..34c77cbb1a 100644
> --- a/send-pack.c
> +++ b/send-pack.c
> @@ -40,7 +40,8 @@ int option_parse_push_signed(const struct option *opt,
>  
>  static void feed_object(const struct object_id *oid, FILE *fh, int negative)
>  {
> -	if (negative && !has_object_file(oid))
> +	if (negative &&
> +	    !has_object_file_with_flags(oid, OBJECT_INFO_SKIP_FETCH_OBJECT))
>  		return;
>  
>  	if (negative)

  reply	other threads:[~2019-10-08  4:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07 21:38 [PATCH] send-pack: never fetch when checking exclusions Jonathan Tan
2019-10-08  4:10 ` Junio C Hamano [this message]
2019-10-08 18:37   ` [PATCH v2] " Jonathan Tan
2019-10-11  6:12     ` Jeff King
2019-10-11 12:31       ` Derrick Stolee
2019-10-11 16:15         ` Jeff King
2019-10-11 22:08           ` Jonathan Tan
2019-10-17  6:10             ` Jeff King
2019-10-12  0:47           ` Junio C Hamano

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=xmqqzhibnahi.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jonathantanmy@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
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).