git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Aniket Gupta
Message 37 of 37 in “bundle-uri: do not die on unresolvable relative URIs”
  1. 0/3 bundle-uri: do not die on unresolvable relative URIsAniket Gupta, Nov 5, 2026
  2. 1/3 remote: add relative_url_gently()Aniket Gupta, Nov 5, 2026
  3. Derrick StoleeNov 6, 2026
  4. 2/3 remote: do not show credentials when relative_url() failsAniket Gupta, Nov 5, 2026
  5. Derrick StoleeNov 6, 2026
  6. Junio C HamanoNov 6, 2026
  7. Aniket GuptaNov 9, 2026
  8. 3/3 bundle-uri: do not die on unresolvable relative URIsAniket Gupta, Nov 5, 2026
  9. Derrick StoleeNov 6, 2026
  10. Derrick StoleeNov 6, 2026
  11. Aniket GuptaNov 6, 2026
  12. Patrick SteinhardtNov 9, 2026
  13. Aniket GuptaNov 9, 2026
  14. 0/3 bundle-uri: do not die on unresolvable relative URIsAniket Gupta, Nov 23, 2026
  15. 1/3 remote: add relative_url_gently()Aniket Gupta, Nov 23, 2026
  16. 2/3 remote: name the original URL when relative_url() failsAniket Gupta, Nov 23, 2026
  17. 3/3 bundle-uri: do not die on unresolvable relative URIsAniket Gupta, Nov 23, 2026
  18. Junio C HamanoNov 23, 2026
  19. Aniket GuptaNov 23, 2026
  20. Derrick StoleeNov 23, 2026
  21. 0/3 bundle-uri: do not die on unresolvable relative URIsAniket Gupta, Nov 26, 2026
  22. 1/3 remote: add relative_url_gently()Aniket Gupta, Nov 26, 2026
  23. 2/3 remote: name the original URL when relative_url() failsAniket Gupta, Nov 26, 2026
  24. Patrick SteinhardtDec 1, 2026
  25. Aniket GuptaDec 1, 2026
  26. 3/3 bundle-uri: do not die on unresolvable relative URIsAniket Gupta, Nov 26, 2026
  27. Derrick StoleeNov 30, 2026
  28. Patrick SteinhardtDec 1, 2026
  29. Aniket GuptaDec 1, 2026
  30. Patrick SteinhardtDec 2, 2026
  31. Patrick SteinhardtDec 1, 2026
  32. Aniket GuptaDec 1, 2026
  33. 0/3 bundle-uri: do not die on unresolvable relative URIsAniket Gupta, Dec 2, 2026
  34. 1/3 remote: add relative_url_gently()Aniket Gupta, Dec 2, 2026
  35. 2/3 remote: name the original URL when relative_url() failsAniket Gupta, Dec 2, 2026
  36. 3/3 bundle-uri: do not die on unresolvable relative URIsAniket Gupta, Dec 2, 2026
  37. Patrick SteinhardtDec 3, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.