Re: [PATCH v4 01/29] trailer: append trailers in-process and drop the fork to `interpret-trailers`
From: Li Chen <hidden>
Date: 2025-10-21 09:57:38
Hi Kristoffer ---- On Wed, 15 Oct 2025 04:43:09 +0800 Kristoffer Haugsbakk [off-list ref] wrote --- > On Tue, Oct 14, 2025, at 14:24, Li Chen wrote: > > From: Li Chen [off-list ref] > > > > Route all trailer insertion through trailer_process() and make > > builtin/interpret-trailers just do file I/O before calling into it. > > amend_file_with_trailers() now shares the same code path. > > > > This removes the fork/exec and tempfile juggling, cutting overhead and > > simplifying error handling. No functional change is intended. It also > > Why “is intended” instead of “No functional change.”? > > > centralizes logic to prepare for follow-up rebase --trailer patch. > > > > Signed-off-by: Li Chen [off-list ref] > > --- > > builtin/interpret-trailers.c | 116 ++++++++------------------------ > > trailer.c | 125 ++++++++++++++++++++++++++++++++--- > > trailer.h | 18 ++++- > > 3 files changed, 157 insertions(+), 102 deletions(-) > >[...] > > new_trailers_clear(&trailers); > > diff --git a/trailer.c b/trailer.c > > index 911a81ed99..8aec466b5f 100644 > > --- a/trailer.c > > +++ b/trailer.c > > @@ -1224,14 +1224,121 @@ void trailer_iterator_release(struct > > trailer_iterator *iter) > > strbuf_release(&iter->key); > > } > > > > -int amend_file_with_trailers(const char *path, const struct strvec > > *trailer_args) > > +static int amend_strbuf_with_trailers(struct strbuf *buf, > > + const struct strvec *trailer_args) > > This needs Clang formatting. I apologize for the 4-space indentation in my previous codes due to my editor settings, which is not align with this project(treat tab as 8 space) I will use clang-format in the next version. Regards, Li