Git development
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Aniket Gupta <aniketgupta3001@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Derrick Stolee <stolee@gmail.com>
Subject: Re: [PATCH v6 3/3] bundle-uri: do not die on unresolvable relative URIs
Date: Thu, 3 Dec 2026 10:28:03 +0100	[thread overview]
Message-ID: <axE2I1w-604KzDV9@pks.im> (raw)
In-Reply-To: <20261202204608.97770-4-aniketgupta3001@gmail.com>

On Thu, Dec 03, 2026 at 02:16:08AM +0530, Aniket Gupta wrote:
> diff --git a/bundle-uri.c b/bundle-uri.c
> index 41c817eefb..4cb5014968 100644
> --- a/bundle-uri.c
> +++ b/bundle-uri.c
> @@ -134,6 +134,19 @@ void print_bundle_list(FILE *fp, struct bundle_list *list)
>  	for_all_bundles_in_list(list, summarize_bundle, fp);
>  }
>  
> +/*
> + * Remove a bundle from the list when its URI cannot be used, so that the
> + * list does not keep an entry without a URI.
> + */

When adding a comment, the question you should ask yourself is whether
the comment adds anything to the code that is not immediately obvious by
reading the code itself. In this case the answer is "no", so all the
comment does is to add additional noise that the reader needs to digest.

Even worse, this comment documents the callsite because you explicitly
mention entries without a URI. There may be other reasons why you want
to remove the bundle from the list, even though we currently have no
such other callsites. But once we grow new callsites the comment would
become stale immediately.

So my suggestion would be to simply drop the comment.

> +static int drop_bundle(struct bundle_list *list,
> +		       struct remote_bundle_info *bundle)
> +{
> +	hashmap_remove(&list->bundles, &bundle->ent, NULL);
> +	clear_remote_bundle_info(bundle, NULL);
> +	free(bundle);
> +	return -1;
> +}

Patrick

      reply	other threads:[~2026-12-03  9:28 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05 15:28 [PATCH v3 0/3] bundle-uri: do not die on unresolvable relative URIs Aniket Gupta
2026-11-05 15:28 ` [PATCH v3 1/3] remote: add relative_url_gently() Aniket Gupta
2026-11-06 14:36   ` Derrick Stolee
2026-11-05 15:28 ` [PATCH v3 2/3] remote: do not show credentials when relative_url() fails Aniket Gupta
2026-11-06 14:43   ` Derrick Stolee
2026-11-06 19:15     ` Junio C Hamano
2026-11-09 10:39     ` Aniket Gupta
2026-11-05 15:28 ` [PATCH v3 3/3] bundle-uri: do not die on unresolvable relative URIs Aniket Gupta
2026-11-06 14:51   ` Derrick Stolee
2026-11-06 14:57 ` [PATCH v3 0/3] " Derrick Stolee
2026-11-06 17:25   ` Aniket Gupta
2026-11-09  9:26     ` Patrick Steinhardt
2026-11-09 10:56       ` Aniket Gupta
2026-11-23  6:44 ` [PATCH v4 " Aniket Gupta
2026-11-23  6:44   ` [PATCH v4 1/3] remote: add relative_url_gently() Aniket Gupta
2026-11-23  6:44   ` [PATCH v4 2/3] remote: name the original URL when relative_url() fails Aniket Gupta
2026-11-23  6:44   ` [PATCH v4 3/3] bundle-uri: do not die on unresolvable relative URIs Aniket Gupta
2026-11-23 21:04     ` Junio C Hamano
2026-11-23 22:25       ` Aniket Gupta
2026-11-23 14:54   ` [PATCH v4 0/3] " Derrick Stolee
2026-11-26 11:58 ` [PATCH v5 " Aniket Gupta
2026-11-26 11:58   ` [PATCH v5 1/3] remote: add relative_url_gently() Aniket Gupta
2026-11-26 11:58   ` [PATCH v5 2/3] remote: name the original URL when relative_url() fails Aniket Gupta
2026-12-01 12:35     ` Patrick Steinhardt
2026-12-01 14:58       ` Aniket Gupta
2026-11-26 11:58   ` [PATCH v5 3/3] bundle-uri: do not die on unresolvable relative URIs Aniket Gupta
2026-11-30 19:11     ` Derrick Stolee
2026-12-01 12:35     ` Patrick Steinhardt
2026-12-01 15:43       ` Aniket Gupta
2026-12-02 11:10         ` Patrick Steinhardt
2026-12-01 12:34   ` [PATCH v5 0/3] " Patrick Steinhardt
2026-12-01 14:46     ` Aniket Gupta
2026-12-02 20:46   ` [PATCH v6 " Aniket Gupta
2026-12-02 20:46     ` [PATCH v6 1/3] remote: add relative_url_gently() Aniket Gupta
2026-12-02 20:46     ` [PATCH v6 2/3] remote: name the original URL when relative_url() fails Aniket Gupta
2026-12-02 20:46     ` [PATCH v6 3/3] bundle-uri: do not die on unresolvable relative URIs Aniket Gupta
2026-12-03  9:28       ` Patrick Steinhardt [this message]

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=axE2I1w-604KzDV9@pks.im \
    --to=ps@pks.im \
    --cc=aniketgupta3001@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=stolee@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox