git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Nicolas Guichard via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	 Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Nicolas Guichard <nicolas@guichard.eu>
Subject: Re: [PATCH v2 2/3] rebase-update-refs: extract load_branch_decorations
Date: Fri, 4 Oct 2024 23:44:47 -0400	[thread overview]
Message-ID: <CAPig+cT9dofoAPbRCzp-VGHDK9qpy2r2f09aExN=WYFbR0n8aA@mail.gmail.com> (raw)
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:
> 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`

  reply	other threads:[~2024-10-05  3:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-21 18:37 [PATCH 0/2] rebase-merges: try and use branch names for labels Nicolas Guichard via GitGitGadget
2024-09-21 18:37 ` [PATCH 1/2] sequencer.c: extract load_branch_decorations Nicolas Guichard via GitGitGadget
2024-09-23 19:32   ` Junio C Hamano
2024-09-21 18:38 ` [PATCH 2/2] rebase-merges: try and use branch names as labels Nicolas Guichard via GitGitGadget
2024-09-23 19:38   ` Junio C Hamano
2024-10-04 23:22 ` [PATCH v2 0/3] rebase-merges: try and use branch names for labels Nicolas Guichard via GitGitGadget
2024-10-04 23:22   ` [PATCH v2 1/3] load_branch_decorations: fix memory leak with non-static filters Nicolas Guichard via GitGitGadget
2024-10-05  3:43     ` Eric Sunshine
2024-10-04 23:22   ` [PATCH v2 2/3] rebase-update-refs: extract load_branch_decorations Nicolas Guichard via GitGitGadget
2024-10-05  3:44     ` Eric Sunshine [this message]
2024-10-04 23:22   ` [PATCH v2 3/3] rebase-merges: try and use branch names as labels Nicolas Guichard via GitGitGadget
2024-10-09  7:58   ` [PATCH v3 0/3] rebase-merges: try and use branch names for labels Nicolas Guichard via GitGitGadget
2024-10-09  7:58     ` [PATCH v3 1/3] load_branch_decorations: fix memory leak with non-static filters Nicolas Guichard via GitGitGadget
2024-10-09  7:58     ` [PATCH v3 2/3] rebase-update-refs: extract load_branch_decorations Nicolas Guichard via GitGitGadget
2024-10-09  7:58     ` [PATCH v3 3/3] rebase-merges: try and use branch names as labels Nicolas Guichard via GitGitGadget
2024-10-09 14:21       ` Phillip Wood
2024-10-09 17:57         ` Junio C Hamano
2024-10-09 14:22     ` [PATCH v3 0/3] rebase-merges: try and use branch names for labels Phillip Wood

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='CAPig+cT9dofoAPbRCzp-VGHDK9qpy2r2f09aExN=WYFbR0n8aA@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=nicolas@guichard.eu \
    /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;
as well as URLs for NNTP newsgroup(s).