All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emily Shaffer <emilyshaffer@google.com>
To: Jonathan Tan <jonathantanmy@google.com>
Cc: git@vger.kernel.org, gitster@pobox.com, jrnieder@gmail.com
Subject: Re: [PATCH v3 1/2] revision: document get_reference()
Date: Wed, 25 Mar 2020 13:46:17 -0700	[thread overview]
Message-ID: <20200325204617.GA53368@google.com> (raw)
In-Reply-To: <6dce9c79be3b9264f832852e9068347f42cf3ee0.1578781770.git.jonathantanmy@google.com>

On Sat, Jan 11, 2020 at 02:34:55PM -0800, Jonathan Tan wrote:
> In particular, document the behavior when the object is corrupt. The
> existing behavior when parse_object() encounters a hash mismatch has
> been there since cc243c3ceb ("show: --ignore-missing", 2011-05-19), and
> the existing behavior when the code disagrees on whether an object is a
> commit has been there since ec0c5798ee ("revision: use commit graph in
> get_reference()", 2018-12-28).

Does "disagreement on whether an object is a commit" count as corrupt
object? Otherwise I'm not seeing mention of it in the comment that was
added.

> ---
>  revision.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/revision.c b/revision.c
> index 8136929e23..91ca194388 100644
> --- a/revision.c
> +++ b/revision.c
> @@ -355,6 +355,16 @@ void add_head_to_pending(struct rev_info *revs)
>  	add_pending_object(revs, obj, "HEAD");
>  }
>  
> +/*
> + * Returns the object corresponding to "oid" and sets the given flags on
> + * it.
> + *
> + * If that object is missing or corrupt, this function returns NULL if
> + * "revs" permits it (that is, if revs->ignore_missing is true or if
> + * revs->exclude_promisor_objects is true and the object is a promisor
> + * object), and dies otherwise. Note that corrupt objects are treated

The parenthetical is hard to parse. Is it "(revs->ignore_missing is
true) or (revs->exclude_promisor_objects is true and the object is a
promisor)" or something else? Maybe an extra comma,

  (that is, if revs->ignore_missing is true, or if
  revs->exclude_promisor_objects is true and the object is a promisor
  object)

> + * like missing objects, to preserve existing behavior.
> + */
>  static struct object *get_reference(struct rev_info *revs, const char *name,
>  				    const struct object_id *oid,
>  				    unsigned int flags)
> -- 
> 2.25.0.rc1.283.g88dfdc4193-goog
> 

  reply	other threads:[~2020-03-25 20:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-28  0:34 [PATCH] revision: allow missing promisor objects on CLI Jonathan Tan
2019-12-28  3:50 ` Junio C Hamano
2019-12-30 18:38   ` Jonathan Tan
2019-12-30 20:33     ` Junio C Hamano
2019-12-30 23:44 ` [PATCH v2] " Jonathan Tan
2019-12-31  0:09   ` Jonathan Nieder
2020-01-02 20:49     ` Jonathan Tan
2020-01-11 22:34 ` [PATCH v3 0/2] Un-regress rev-list --exclude-promisor-objects Jonathan Tan
2020-01-11 22:34   ` [PATCH v3 1/2] revision: document get_reference() Jonathan Tan
2020-03-25 20:46     ` Emily Shaffer [this message]
2020-01-11 22:34   ` [PATCH v3 2/2] revision: un-regress --exclude-promisor-objects Jonathan Tan
2020-03-25 20:50     ` Emily Shaffer

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=20200325204617.GA53368@google.com \
    --to=emilyshaffer@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jonathantanmy@google.com \
    --cc=jrnieder@gmail.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.