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

Re: [PATCH 2/5] refs: add `exclude_patterns` parameter to `for_each_fullref_in()`

From
Taylor Blau <me@ttaylorr.com>
Date
May 3, 2024, 18:44 UTC
Message-ID
<ZjUwmeghHMH254w0@nand.local>
In-Reply-To
<4f34bb2e03479b4987ef30330f096650de354b06.1714717057.git.ps@pks.im>
On Fri, May 03, 2024 at 08:28:04AM +0200, Patrick Steinhardt wrote:
Show 5 quoted lines
> The `for_each_fullref_in()` function is supposedly the ref-store-less
> equivalent of `refs_for_each_fullref_in()`, but the latter has gained a
> new parameter `exclude_patterns` over time. Bring these two functions
> back in sync again by adding the parameter to the former function, as
> well.

Much appreciated. I think that this one is my doing from b269ac53c07 (refs: plumb `exclude_patterns` argument throughout, 2023-07-10), which only touched refs_for_each_fullref_in(), not for_each_fullref_in().

Thanks for bringing the two into line with one another.
Show 24 quoted lines
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
>  builtin/rev-parse.c |  4 ++--
>  builtin/show-ref.c  |  4 ++--
>  ref-filter.c        | 10 +++++-----
>  refs.c              |  8 +++++---
>  refs.h              |  3 ++-
>  5 files changed, 16 insertions(+), 13 deletions(-)
>
> diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
> index 624182e507..2b28d43939 100644
> --- a/builtin/rev-parse.c
> +++ b/builtin/rev-parse.c
> @@ -908,8 +908,8 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
>  				continue;
>  			}
>  			if (!strcmp(arg, "--bisect")) {
> -				for_each_fullref_in("refs/bisect/bad", show_reference, NULL);
> -				for_each_fullref_in("refs/bisect/good", anti_reference, NULL);
> +				for_each_fullref_in("refs/bisect/bad", NULL, show_reference, NULL);
> +				for_each_fullref_in("refs/bisect/good", NULL, anti_reference, NULL);
>  				continue;
>  			}
>  			if (opt_with_value(arg, "--branches", &arg)) {

Here and below, passing NULL for 'exclude_patterns' is expected, since we have no such patterns in the first place.

Looking good.

Thanks, Taylor

Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 5 of 32 in “refs: remove functions without ref store”
  1. 0/5 refs: remove functions without ref storePatrick Steinhardt, May 3, 2024
  2. 1/5 refs: introduce missing functions that accept a `struct ref_store`Patrick Steinhardt, May 3, 2024
  3. Junio C HamanoMay 3, 2024
  4. 2/5 refs: add `exclude_patterns` parameter to `for_each_fullref_in()`Patrick Steinhardt, May 3, 2024
  5. Taylor BlauMay 3, 2024
  6. 3/5 cocci: introduce rules to transform "refs" to pass ref storePatrick Steinhardt, May 3, 2024
  7. 4/5 cocci: apply rules to rewrite callers of "refs" interfacesPatrick Steinhardt, May 3, 2024
  8. Taylor BlauMay 3, 2024
  9. Junio C HamanoMay 3, 2024
  10. Patrick SteinhardtMay 6, 2024
  11. 5/5 refs: remove functions without ref storePatrick Steinhardt, May 3, 2024
  12. James LiuMay 6, 2024
  13. Junio C HamanoMay 3, 2024
  14. Jeff KingMay 3, 2024
  15. Junio C HamanoMay 3, 2024
  16. Patrick SteinhardtMay 6, 2024
  17. Junio C HamanoMay 6, 2024
  18. Patrick SteinhardtMay 7, 2024
  19. Junio C HamanoMay 7, 2024
  20. Patrick SteinhardtMay 7, 2024
  21. Junio C HamanoMay 7, 2024
  22. Jeff KingMay 9, 2024
  23. Patrick SteinhardtMay 10, 2024
  24. Taylor BlauMay 3, 2024
  25. Junio C HamanoMay 3, 2024
  26. 0/5 refs: remove functions without ref storePatrick Steinhardt, May 7, 2024
  27. 1/5 refs: introduce missing functions that accept a `struct ref_store`Patrick Steinhardt, May 7, 2024
  28. 2/5 refs: add `exclude_patterns` parameter to `for_each_fullref_in()`Patrick Steinhardt, May 7, 2024
  29. 3/5 cocci: introduce rules to transform "refs" to pass ref storePatrick Steinhardt, May 7, 2024
  30. 4/5 cocci: apply rules to rewrite callers of "refs" interfacesPatrick Steinhardt, May 7, 2024
  31. 5/5 refs: remove functions without ref storePatrick Steinhardt, May 7, 2024
  32. Taylor BlauMay 7, 2024

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.