[RFC PATCH 0/2] rebase: support --trailer and add --reviewby
- From
Li Chen <me@linux.beauty>
- Date
- May 6, 2025, 12:57 UTC
- Message-ID
- <196a5ac1393.f5b4db7d187309.2451613571977217927@linux.beauty>
From: Li Chen <chenl311@chinatelecom.cn>
This patch series enhances `git rebase` and `git am` by introducing three features:
1. `--trailer <line>` support on rebase's merge backend
Allows arbitrary trailer lines (e.g. multiple “Reviewed-by: …”) to be appended
to each rebased commit. The apply backend (`git am`) is explicitly
rejected when used with `--trailer`, since it has no message‑filter/trailer support. This is especially useful when reviewee add reviewer's Reviewed-by, e.g.,
git rebase \
--trailer "Reviewed-by: Bob <bob@example.com>" \
--trailer "Tested-by: Dana <dana@example.com>" \
base~1 2. `--reviewby` shortcut flag for rebase
A convenience alias for adding a single “Reviewed‑by:” trailer using your configured
committer identity (user.name/user.email), analogous to --signoff. It works on both
rebase backends (merge and apply) and automatically disables fast‑forwarding to
rewrite commits. This is especially useful when reviewer adds his/her Reviewed-by for a given patchset
which is already applied, e.g., git rebase --reviewby base~13. BTW, `--reviewby` shortcut flag is also added for `am` cmd, because it's needed by rebase's apply backend.
I’ve run make test locally without failures. There are Github CI errors around leak checks that I’m still tracking down (see https://github.com/FirstLoveLife/git/actions/runs/14859027869).
Looking forward to your feedback!
Li Chen (2): rebase, am: add --reviewby option rebase: support --trailer
Documentation/git-am.adoc | 6 +- builtin/am.c | 31 +++++++++ builtin/rebase.c | 84 ++++++++++++++++++++++ builtin/revert.c | 4 +- sequencer.c | 100 ++++++++++++++++++++++++++- sequencer.h | 12 ++++ t/meson.build | 2 + t/t3439-rebase-reviewby.sh | 138 +++++++++++++++++++++++++++++++++++++ t/t3440-rebase-trailer.sh | 108 +++++++++++++++++++++++++++++ t/t4150-am.sh | 75 ++++++++++++++++++++ 10 files changed, 556 insertions(+), 4 deletions(-) create mode 100755 t/t3439-rebase-reviewby.sh create mode 100755 t/t3440-rebase-trailer.sh
-- 2.49.0