All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Karthik Nayak <karthik.188@gmail.com>
Cc: git@vger.kernel.org, me@ttaylorr.com
Subject: Re: [PATCH v3] revision: add `--ignore-missing-links` user option
Date: Fri, 15 Sep 2023 11:54:09 -0700	[thread overview]
Message-ID: <xmqqfs3fe08e.fsf@gitster.g> (raw)
In-Reply-To: <20230915083415.263187-1-knayak@gitlab.com> (Karthik Nayak's message of "Fri, 15 Sep 2023 10:34:15 +0200")

Karthik Nayak <karthik.188@gmail.com> writes:

> From: Karthik Nayak <karthik.188@gmail.com>
>
> The revision backend is used by multiple porcelain commands such as
> git-rev-list(1) and git-log(1). The backend currently supports ignoring
> missing links by setting the `ignore_missing_links` bit. This allows the
> revision walk to skip any objects links which are missing. Expose this
> bit via an `--ignore-missing-links` user option.

Given the above "we merely surface a feature that already exists and
supported to be used by the end users from the command line" claim ...

> diff --git a/builtin/rev-list.c b/builtin/rev-list.c
> index ff715d6918..5239d83c76 100644
> --- a/builtin/rev-list.c
> +++ b/builtin/rev-list.c
> @@ -266,7 +266,8 @@ static int finish_object(struct object *obj, const char *name UNUSED,
>  {
>  	struct rev_list_info *info = cb_data;
>  	if (oid_object_info_extended(the_repository, &obj->oid, NULL, 0) < 0) {
> -		finish_object__ma(obj);
> +		if (!info->revs->ignore_missing_links)
> +			finish_object__ma(obj);
>  		return 1;
>  	}

... this hunk is a bit unexpected.  As a low-level plumbing command,
shouldn't it be left to the user who gives --ignore-missing-links
from their command line to specify how the missing "obj" here should
be dealt with by giving the "--missing=<foo>" option?  While giving
"allow-promisor" may not make much sense, "--missing=allow-any" may
of course make sense (it is the same as hardcoding the decision not
to call finish_object__ma() at all), and so may "--missing=print".

Stepping back a bit, with "--missing=print", is this change still
needed?  The missing objects discovered will be shown at the end,
with the setting, no?

Thanks.


  reply	other threads:[~2023-09-15 18:56 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-08 17:42 [PATCH] revision: add `--ignore-missing-links` user option Karthik Nayak
2023-09-08 19:19 ` Junio C Hamano
2023-09-12 14:42   ` Karthik Nayak
2023-09-12 15:58 ` [PATCH v2] " Karthik Nayak
2023-09-12 17:07   ` Taylor Blau
2023-09-13  9:32     ` Karthik Nayak
2023-09-13 17:17       ` Taylor Blau
2023-09-15  8:34   ` [PATCH v3] " Karthik Nayak
2023-09-15 18:54     ` Junio C Hamano [this message]
2023-09-18 10:12       ` Karthik Nayak
2023-09-18 15:56         ` Junio C Hamano
2023-09-19  8:45           ` Karthik Nayak
2023-09-19 15:13             ` Junio C Hamano
2023-09-20 10:45     ` [PATCH v4] " Karthik Nayak
2023-09-20 15:32       ` Junio C Hamano
2023-09-21 10:53         ` Karthik Nayak
2023-09-21 19:16           ` Junio C Hamano
2023-09-24 16:14             ` Karthik Nayak
2023-09-25 16:57               ` Junio C Hamano
2023-09-27 16:26                 ` Karthik Nayak

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

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

  git send-email \
    --in-reply-to=xmqqfs3fe08e.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=karthik.188@gmail.com \
    --cc=me@ttaylorr.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.