[RFC PATCH 0/2] rebase: support --trailer and add --reviewby

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Li Chen <chenl311@xxxxxxxxxxxxxxx>

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@xxxxxxxxxxx>" \
    --trailer "Tested-by: Dana <dana@xxxxxxxxxxx>" \
    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






[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux