git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Eric Wong <e@80x24.org>
Cc: git@vger.kernel.org, Patrick Steinhardt <ps@pks.im>
Subject: Re: [RFC] fetch: support hideRefs to speed up connectivity checks
Date: Sat, 11 Feb 2023 11:24:35 -0800	[thread overview]
Message-ID: <xmqqv8k8dmz0.fsf@gitster.g> (raw)
In-Reply-To: <20230211075333.M933000@dcvr> (Eric Wong's message of "Sat, 11 Feb 2023 07:53:33 +0000")

Eric Wong <e@80x24.org> writes:

> Junio C Hamano <gitster@pobox.com> wrote:
>> I however notice error handling in the codepath that deals with
>> "--exclude-hidden" is  a bit sloppy.
>> 
>> refs.c::parse_hide_refs_config() is nice enough to diagnose a
>> malformed transfer.hiderefs configuration as an error by returning
>> -1, and revision.c::hide_refs_config() propagates such an error up,
>> but revision.c::exclude_hidden_refs() ignores the error from
>> git_config(), and revision.c::handle_revision_pseudo_opt() ignores
>> any error from exclude_hidden_refs() anyway.
>
> Not sure I follow.  exclude_hidden_refs() either dies or calls
> git_config().  git_config() calls repo_config(), then
> configset_iter().  configset_iter() will git_die_config_linenr()
> if `fn' (hide_refs_config() in this case) returns < 0.

Somehow I had this wishful thinking that the return value from
git_config() can be checked and the caller can handle the error more
gracefully, but its return type is void.  We'll die when we see a
bad configuration but only when we see "--exclude-hidden", which is
when we need a valid value from there.  That is how it should work,
so I am now happier.

Thanks.

  reply	other threads:[~2023-02-11 19:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09 12:28 [RFC] fetch: support hideRefs to speed up connectivity checks Eric Wong
2023-02-10 21:49 ` Jonathan Tan
2023-02-10 21:59   ` Eric Wong
2023-02-10 22:56 ` Junio C Hamano
2023-02-11  7:53   ` Eric Wong
2023-02-11 19:24     ` Junio C Hamano [this message]
2023-02-12  9:04 ` [PATCH v2] " Eric Wong
2023-02-13 20:53   ` Jeff King
2023-02-13 23:30     ` Philip Oakley
2023-02-14  1:40       ` Jeff King
2023-02-16  1:32         ` Eric Wong

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=xmqqv8k8dmz0.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=e@80x24.org \
    --cc=git@vger.kernel.org \
    --cc=ps@pks.im \
    /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).