Re: [PATCH 05/10] sequencer: use the trailer iterator
- From
- Linus Arver <linusa@google.com>
- Date
- Jan 22, 2024, 23:22 UTC
- Message-ID
- <owlyjzo1vtqs.fsf@fine.c.googlers.com>
- In-Reply-To
- <fd4a9d54d9522973a4c22e43cb1d7964033d4837.1704869487.git.gitgitgadget@gmail.com>
"Linus Arver via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 15 quoted lines
> diff --git a/trailer.h b/trailer.h
> index 50f70556302..d50c9fd79b2 100644
> --- a/trailer.h
> +++ b/trailer.h
> @@ -127,6 +127,19 @@ struct trailer_iterator {
> struct strbuf key;
> struct strbuf val;
>
> + /*
> + * Raw line (e.g., "foo: bar baz") before being parsed as a trailer
> + * key/val pair. This field can contain non-trailer lines because it's
> + * valid for a trailer block to contain such lines (i.e., we only
> + * require 25% of the lines in a trailer block to be trailer lines).
> + */
> + struct strbuf raw;Originally I used a strbuf here for consistency with the other strbufs used in the iterator for the key and val members. But now I've realized that there's no need to make "raw" a strbuf at all, because iterator users will never need to manipulate the string that this points to. Will change to just "const char *" in the reroll.