Re: [PATCH v6 3/3] bundle-uri: do not die on unresolvable relative URIs
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Dec 3, 2026, 09:28 UTC
- Message-ID
- <axE2I1w-604KzDV9@pks.im>
- In-Reply-To
- <20261202204608.97770-4-aniketgupta3001@gmail.com>
On Thu, Dec 03, 2026 at 02:16:08AM +0530, Aniket Gupta wrote:
Show 12 quoted lines
> 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.
Show 8 quoted lines
> +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