git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[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~1
3. 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

Next: Li Chen
Message 1 of 16 in “rebase: support --trailer and add --reviewby”
  1. 0/2 rebase: support --trailer and add --reviewbyLi Chen, May 6, 2025
  2. 1/2 rebase, am: add --reviewby optionLi Chen, May 6, 2025
  3. Junio C HamanoMay 6, 2025
  4. Li ChenMay 7, 2025
  5. Phillip WoodMay 7, 2025
  6. Phillip WoodMay 7, 2025
  7. Kristoffer HaugsbakkMay 7, 2025
  8. Phillip WoodMay 7, 2025
  9. Junio C HamanoMay 7, 2025
  10. 2/2 rebase: support --trailerLi Chen, May 6, 2025
  11. Phillip WoodMay 8, 2025
  12. Li ChenMay 8, 2025
  13. phillip.wood123@gmail.comMay 8, 2025
  14. Phillip WoodMay 8, 2025
  15. Li ChenMay 16, 2025
  16. Phillip WoodMay 16, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.