From: Li Chen <me@linux.beauty>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
Phillip Wood <phillip.wood@dunelm.org.uk>,
Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Subject: [PATCH v7 0/5] rebase: support --trailer
Date: Tue, 24 Feb 2026 15:05:46 +0800 [thread overview]
Message-ID: <20260224070552.148591-1-me@linux.beauty> (raw)
Apologies for the long delay in sending v7.
v7 is based on origin/master at v2.53.0-154-g7c02d39fc2.
This series routes trailer insertion through an in-process path, removing the
fork/exec to builtin/interpret-trailers.
The first four commits refactor trailer rewriting in builtin/interpret-trailers
and trailer.c so callers can reuse a single in-process helper (used by git
interpret-trailers, git commit and git tag). The final commit adds git rebase
--trailer, currently supported with the merge backend only (rejecting apply-only
scenarios and validating input early).
v7:
Rebased onto origin/master at v2.53.0-154-g7c02d39fc2.
Split out a new patch to parse --trailer with OPT_STRVEC in git commit and git
tag.
Use strbuf_write() in interpret-trailers when emitting buffered output.
Restore --in-place rewriting semantics via tempfile+rename.
Drop wrapper.c/h and validate trailer args via validate_trailer_args().
Drop redundant rebase basic-state save/restore for --trailer arguments.
v6: squash all fix commits and split refactor step from the original patch
based on Phillip's suggestion and code [4].
v5: fix all Kristoffer's review comments from v4[3] in place and without new
patches.
v4: fix all reviewer comments in v3. [2], and add patch 1~8 & 10~29 to fix
review comments.
v3: merges the remaining trailer paths into one in-process helper, dropping the
duplicate code, as pointed by Junio and Phillip [1]
v2: fix issues pointed by Phillip
RFC link:
https://lore.kernel.org/git/196a5ac1393.f5b4db7d187309.2451613571977217927@linux.beauty/
Comments very very welcome!
[1]: https://lore.kernel.org/git/xmqq8qlzkukw.fsf@gitster.g/
[2]: https://lore.kernel.org/git/20250803150059.402017-1-me@linux.beauty/
[3]: https://lore.kernel.org/git/20251014122452.1851103-1-me@linux.beauty/
[4]: https://lore.kernel.org/git/7d12b046-365f-441c-af8e-8a39d61efbbd@gmail.com/
Li Chen (5):
interpret-trailers: factor trailer rewriting
trailer: move process_trailers to trailer.h
trailer: append trailers without fork/exec
commit, tag: parse --trailer with OPT_STRVEC
rebase: support --trailer
Documentation/git-rebase.adoc | 7 ++
builtin/commit.c | 3 +-
builtin/interpret-trailers.c | 47 ++-------
builtin/rebase.c | 18 ++++
builtin/tag.c | 4 +-
sequencer.c | 28 ++++++
sequencer.h | 3 +
t/meson.build | 1 +
t/t3440-rebase-trailer.sh | 147 ++++++++++++++++++++++++++++
trailer.c | 179 ++++++++++++++++++++++++++++++++--
trailer.h | 30 +++++-
11 files changed, 414 insertions(+), 53 deletions(-)
create mode 100755 t/t3440-rebase-trailer.sh
--
2.52.0
next reply other threads:[~2026-02-24 7:06 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-24 7:05 Li Chen [this message]
2026-02-24 7:05 ` [PATCH v7 1/5] interpret-trailers: factor trailer rewriting Li Chen
2026-03-02 14:56 ` Phillip Wood
2026-03-02 15:00 ` Li Chen
2026-02-24 7:05 ` [PATCH v7 2/5] trailer: move process_trailers to trailer.h Li Chen
2026-03-02 14:56 ` phillip.wood123
2026-02-24 7:05 ` [PATCH v7 3/5] trailer: append trailers without fork/exec Li Chen
2026-03-02 14:56 ` Phillip Wood
2026-02-24 7:05 ` [PATCH v7 4/5] commit, tag: parse --trailer with OPT_STRVEC Li Chen
2026-03-02 14:56 ` Phillip Wood
2026-02-24 7:05 ` [PATCH v7 5/5] rebase: support --trailer Li Chen
2026-03-03 15:05 ` Phillip Wood
2026-03-03 20:36 ` Kristoffer Haugsbakk
2026-03-03 21:18 ` Junio C Hamano
2026-03-04 15:53 ` Phillip Wood
2026-03-04 17:22 ` Junio C Hamano
2026-02-26 16:52 ` [PATCH v7 0/5] " Junio C Hamano
2026-02-26 18:15 ` Phillip Wood
2026-02-26 21:12 ` Kristoffer Haugsbakk
2026-03-04 14:29 ` Phillip Wood
2026-03-05 13:49 ` Li Chen
2026-03-06 14:55 ` Phillip Wood
2026-03-06 14:53 ` [PATCH v8 0/6] " Phillip Wood
2026-03-06 14:53 ` [PATCH v8 1/6] interpret-trailers: factor trailer rewriting Phillip Wood
2026-03-06 21:04 ` Junio C Hamano
2026-03-09 10:36 ` Phillip Wood
2026-03-06 14:53 ` [PATCH v8 2/6] interpret-trailers: refactor create_in_place_tempfile() Phillip Wood
2026-03-06 21:05 ` Junio C Hamano
2026-03-06 14:53 ` [PATCH v8 3/6] trailer: libify a couple of functions Phillip Wood
2026-03-06 14:53 ` [PATCH v8 4/6] trailer: append trailers without fork/exec Phillip Wood
2026-03-06 14:53 ` [PATCH v8 5/6] commit, tag: parse --trailer with OPT_STRVEC Phillip Wood
2026-03-06 14:53 ` [PATCH v8 6/6] rebase: support --trailer Phillip Wood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260224070552.148591-1-me@linux.beauty \
--to=me@linux.beauty \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=kristofferhaugsbakk@fastmail.com \
--cc=phillip.wood@dunelm.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox