Re: [PATCH v4 01/29] trailer: append trailers in-process and drop the fork to `interpret-trailers`
From: Kristoffer Haugsbakk <hidden>
Date: 2025-10-14 20:43:31
On Tue, Oct 14, 2025, at 14:24, Li Chen wrote:
From: Li Chen <redacted> 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.”?
quoted hunk ↗ jump to hunk
centralizes logic to prepare for follow-up rebase --trailer patch. Signed-off-by: Li Chen <redacted> --- 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(structtrailer_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.
{
- struct child_process run_trailer = CHILD_PROCESS_INIT;
[snip]