Re: [PATCH v4 01/29] trailer: append trailers in-process and drop the fork to `interpret-trailers`
- From
Li Chen <me@linux.beauty>
- Date
- Oct 21, 2025, 09:57 UTC
- Message-ID
- <19a0633b726.5e87d7b93115820.5703222217950198481@linux.beauty>
- In-Reply-To
- <a0fae0cf-a1c0-4086-bcc0-a66f1aedf512@app.fastmail.com>
Hi Kristoffer
---- On Wed, 15 Oct 2025 04:43:09 +0800 Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com> wrote --- > On Tue, Oct 14, 2025, at 14:24, Li Chen wrote: > > From: Li Chen <chenl311@chinatelecom.cn> > > > > 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 <chenl311@chinatelecom.cn> > > --- > > 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