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

Re: [PATCH v2 2/3] rebase-update-refs: extract load_branch_decorations

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Oct 5, 2024, 03:44 UTC
Message-ID
<CAPig+cT9dofoAPbRCzp-VGHDK9qpy2r2f09aExN=WYFbR0n8aA@mail.gmail.com>
In-Reply-To
<167418d10d137cbcd278a98c95168150df10627d.1728084140.git.gitgitgadget@gmail.com>

On Fri, Oct 4, 2024 at 7:22 PM Nicolas Guichard via GitGitGadget <gitgitgadget@gmail.com> wrote:

Show 29 quoted lines
> Extract load_branch_decorations from todo_list_add_update_ref_commands so
> it can be re-used in make_script_with_merges.
>
> Since it can now be called multiple times, use non-static lists and place
> it next to load_ref_decorations to re-use the decoration_loaded guard.
>
> Signed-off-by: Nicolas Guichard <nicolas@guichard.eu>
> ---
> diff --git a/log-tree.c b/log-tree.c
> @@ -248,6 +248,27 @@ void load_ref_decorations(struct decoration_filter *filter, int flags)
> +void load_branch_decorations(void)
> +{
> +       if (!decoration_loaded) {
> +               struct string_list decorate_refs_exclude = STRING_LIST_INIT_NODUP;
> +               struct string_list decorate_refs_exclude_config = STRING_LIST_INIT_NODUP;
> +               struct string_list decorate_refs_include = STRING_LIST_INIT_NODUP;
> +               struct decoration_filter decoration_filter = {
> +                       .include_ref_pattern = &decorate_refs_include,
> +                       .exclude_ref_pattern = &decorate_refs_exclude,
> +                       .exclude_ref_config_pattern = &decorate_refs_exclude_config,
> +               };
> +
> +               string_list_append(&decorate_refs_include, "refs/heads/");
> +               load_ref_decorations(&decoration_filter, 0);
> +
> +               string_list_clear(&decorate_refs_exclude, false);
> +               string_list_clear(&decorate_refs_exclude_config, false);
> +               string_list_clear(&decorate_refs_include, false);
> +       }
Same minor style nit as previous patch:
* use 0 instead of `false`
Previous: Nicolas Guichard via GitGitGadgetNext: Nicolas Guichard via GitGitGadget
Message 10 of 18 in “rebase-merges: try and use branch names for labels”
  1. 0/2 rebase-merges: try and use branch names for labelsNicolas Guichard via GitGitGadget, Sep 21, 2024
  2. 1/2 sequencer.c: extract load_branch_decorationsNicolas Guichard via GitGitGadget, Sep 21, 2024
  3. Junio C HamanoSep 23, 2024
  4. 2/2 rebase-merges: try and use branch names as labelsNicolas Guichard via GitGitGadget, Sep 21, 2024
  5. Junio C HamanoSep 23, 2024
  6. 0/3 rebase-merges: try and use branch names for labelsNicolas Guichard via GitGitGadget, Oct 4, 2024
  7. 1/3 load_branch_decorations: fix memory leak with non-static filtersNicolas Guichard via GitGitGadget, Oct 4, 2024
  8. Eric SunshineOct 5, 2024
  9. 2/3 rebase-update-refs: extract load_branch_decorationsNicolas Guichard via GitGitGadget, Oct 4, 2024
  10. Eric SunshineOct 5, 2024
  11. 3/3 rebase-merges: try and use branch names as labelsNicolas Guichard via GitGitGadget, Oct 4, 2024
  12. 0/3 rebase-merges: try and use branch names for labelsNicolas Guichard via GitGitGadget, Oct 9, 2024
  13. 1/3 load_branch_decorations: fix memory leak with non-static filtersNicolas Guichard via GitGitGadget, Oct 9, 2024
  14. 2/3 rebase-update-refs: extract load_branch_decorationsNicolas Guichard via GitGitGadget, Oct 9, 2024
  15. 3/3 rebase-merges: try and use branch names as labelsNicolas Guichard via GitGitGadget, Oct 9, 2024
  16. Phillip WoodOct 9, 2024
  17. Junio C HamanoOct 9, 2024
  18. Phillip WoodOct 9, 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.