Re: [PATCH v4 09/29] rebase: support --trailer
From: Li Chen <hidden>
Date: 2025-10-22 03:55:49
Hi Kristoffer ---- On Wed, 15 Oct 2025 04:43:33 +0800 Kristoffer Haugsbakk [off-list ref] wrote --- > On Tue, Oct 14, 2025, at 14:24, Li Chen wrote: > > From: Li Chen [off-list ref] > > > > Implement a new `--trailer <text>` option for `git rebase` > > (support merge backend only now), which appends arbitrary > > trailer lines to each rebased commit message. > > > > Reject it if the user passes an option that requires the > > apply backend (git am) since it lacks message‑filter/trailer > > hook. otherwise we can just use the merge backend. > > > > Automatically set REBASE_FORCE when any trailer is supplied. > > > > And reject invalid input before user edit the interactive file. > > s/edit/edits/ > > > > > Signed-off-by: Li Chen [off-list ref] > > --- > > Documentation/git-rebase.adoc | 7 +++ > > builtin/rebase.c | 89 +++++++++++++++++++++++++++++++++ > > sequencer.c | 13 +++++ > > sequencer.h | 4 +- > > t/meson.build | 1 + > > t/t3440-rebase-trailer.sh | 94 +++++++++++++++++++++++++++++++++++ > > 6 files changed, 207 insertions(+), 1 deletion(-) > > create mode 100755 t/t3440-rebase-trailer.sh > > > > diff --git a/Documentation/git-rebase.adoc b/Documentation/git-rebase.adoc > > index 005caf6164..b2003b70d7 100644 > > --- a/Documentation/git-rebase.adoc > > +++ b/Documentation/git-rebase.adoc > > @@ -488,6 +488,13 @@ See also INCOMPATIBLE OPTIONS below. > > that if `--interactive` is given then only commits marked to be > > picked, edited or reworded will have the trailer added. > > + > > +--trailer <trailer>:: > > + Append the given trailer line(s) to every rebased commit > > + message, processed via linkgit:git-interpret-trailers[1]. > > + When this option is present *rebase automatically implies* > > + `--force-rebase` so that fast‑forwarded commits are also > > + rewritten. > > + > > You’ve cut off the second paragraph of `--signoff`. This should be > added after `See also` below. Thanks for catching this. > Probably also with an `=`: > > --trailer=<trailer>:: > It would be added in v6; but both = and should work. Regards, Li