Re: [PATCH v4 21/28] trailer: spread usage of "trailer_block" language
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Feb 12, 2024, 23:39 UTC
- Message-ID
- <CAP8UFD3ZRfrG4s5jox55dYMRF7UT3uYMkyMraEGWRJ2HqBEYZA@mail.gmail.com>
- In-Reply-To
- <38f4b4c4135dfebc06c2b1d5c56854af4b07fedc.1707196348.git.gitgitgadget@gmail.com>
On Tue, Feb 6, 2024 at 6:12 AM Linus Arver via GitGitGadget <gitgitgadget@gmail.com> wrote:
Show 28 quoted lines
>
> From: Linus Arver <linusa@google.com>
>
> Deprecate the "trailer_info" struct name and replace it with
> "trailer_block". The main reason is to help readability, because
> "trailer_info" on the surface sounds like it's about a single trailer
> when in reality it is a collection of contiguous lines, at least 25% of
> which are trailers.
>
> Signed-off-by: Linus Arver <linusa@google.com>
> ---
> builtin/interpret-trailers.c | 25 +++++-----
> trailer.c | 97 ++++++++++++++++++------------------
> trailer.h | 18 +++----
> 3 files changed, 71 insertions(+), 69 deletions(-)
>
> diff --git a/builtin/interpret-trailers.c b/builtin/interpret-trailers.c
> index 6bf8cec005a..f76841c5280 100644
> --- a/builtin/interpret-trailers.c
> +++ b/builtin/interpret-trailers.c
> @@ -140,8 +140,8 @@ static void interpret_trailers(const struct process_trailer_options *opts,
> {
> LIST_HEAD(head);
> struct strbuf sb = STRBUF_INIT;
> - struct strbuf trailer_block = STRBUF_INIT;
> - struct trailer_info *info;
> + struct strbuf tb = STRBUF_INIT;
> + struct trailer_block *trailer_block;I understand that using 'trailer_block' for a 'struct trailer_block *' makes sense and I like the idea behind this patch, but it's unfortunate that 'struct strbuf trailer_block' becomes 'struct strbuf tb'. Also the name change for 'struct strbuf trailer_block' could be in a separate patch.