Re: [PATCH v2 09/10] trailer: move arg handling to interpret-trailers.c
- From
- Linus Arver <linusa@google.com>
- Date
- Jan 28, 2024, 06:39 UTC
- Message-ID
- <owlyede22c8e.fsf@fine.c.googlers.com>
- In-Reply-To
- <1b4bdde65bcb375ce9ef2345814330df92e6d932.1706308737.git.gitgitgadget@gmail.com>
"Linus Arver via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 6 quoted lines
> From: Linus Arver <linusa@google.com> > > We don't move the "arg_item" struct to interpret-trailers.c, because it > is now a struct that contains information about trailers that should be > injected into the input text's own trailers. We will rename this > language as such in a follow-up patch to keep the diff here small.
I forgot to add this follow-up patch in this series. That will be patch 11 in v3, which renames "arg_item" to "trailer_template" (the idea being that trailer templates are used to create new trailers, using the template as a guide).
Show 19 quoted lines
> diff --git a/builtin/interpret-trailers.c b/builtin/interpret-trailers.c
> index 9e41fa20b5f..ad9b9a9f9ef 100644
> --- a/builtin/interpret-trailers.c
> +++ b/builtin/interpret-trailers.c
> @@ -45,23 +45,17 @@ static int option_parse_if_missing(const struct option *opt,
> return trailer_set_if_missing(opt->value, arg);
> }
>
> -static void new_trailers_clear(struct list_head *trailers)
> -{
> - struct list_head *pos, *tmp;
> - struct new_trailer_item *item;
> -
> - list_for_each_safe(pos, tmp, trailers) {
> - item = list_entry(pos, struct new_trailer_item, list);
> - list_del(pos);
> - free(item);
> - }
> -}This function will also get promoted to the API, and will be renamed to "free_new_trailers()" initially in patch 9, but renamed to "free_trailer_templates()" in patch 11 (we wait until patch 11 to introduce the term "template").