]> Kevux Git Server - rit/commit
rebase: support --trailer
authorLi Chen <me@linux.beauty>
Fri, 6 Mar 2026 14:53:32 +0000 (14:53 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 Mar 2026 21:02:20 +0000 (13:02 -0800)
commite4f9d6b0ab2e1903765258991a6265599d0007ce
treee8c55fc7e1698bb2f0a411f717c1b0a01353aeaf
parent5e148696bf86f0173dfc91571d15ba833ec19ccd
rebase: support --trailer

Add a new --trailer=<trailer> option to git rebase to append trailer
lines to each rewritten commit message (merge backend only).

Because the apply backend does not provide a commit-message filter,
reject --trailer when --apply is in effect and require the merge backend
instead.

This option implies --force-rebase so that fast-forwarded commits are
also rewritten. Validate trailer arguments early to avoid starting an
interactive rebase with invalid input.

Add integration tests covering error paths and trailer insertion across
non-interactive and interactive rebases.

Signed-off-by: Li Chen <me@linux.beauty>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-rebase.adoc
builtin/rebase.c
sequencer.c
sequencer.h
t/meson.build
t/t3440-rebase-trailer.sh [new file with mode: 0755]