Skip to content

rebase: support --trailer

Li Chen git 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest5 patches 16 repliesIn review
  2. v64 patches 19 repliesSuperseded
  3. v529 patches 3 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v429 patches13 repliesSuperseded
v32 patches12 repliesSuperseded
v22 patches4 repliesSuperseded

Changes in v7 from the cover letter

Rebased onto origin/master at v2.53.0-154-g7c02d39fc2.
Split out a new patch to parse --trailer with OPT_STRVEC in git commit and git tag.
Use strbuf_write() in interpret-trailers when emitting buffered output. Restore --in-place rewriting semantics via tempfile+rename.
Drop wrapper.c/h and validate trailer args via validate_trailer_args(). Drop redundant rebase basic-state save/restore for --trailer arguments.

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5interpret-trailers: factor trailer rewritingbuiltin/interpret-trailers.c+30 -232 replies
2/5trailer: move process_trailers to trailer.hbuiltin/interpret-trailers.c trailer.c trailer.h+39 -361 reply
3/5trailer: append trailers without fork/execbuiltin/interpret-trailers.c trailer.c trailer.h+179 -141 reply
4/5commit, tag: parse --trailer with OPT_STRVECbuiltin/commit.c builtin/tag.c trailer.c +1 more+7 -251 reply
5/5rebase: support --trailerDocumentation/git-rebase.adoc builtin/rebase.c sequencer.c +3 more+204 -05 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v7 yet.

Read the v7 thread

Cover letter [PATCH v7 0/5] rebase: support --trailer

Apologies for the long delay in sending v7.

v7 is based on origin/master at v2.53.0-154-g7c02d39fc2.

This series routes trailer insertion through an in-process path, removing the fork/exec to builtin/interpret-trailers.

The first four commits refactor trailer rewriting in builtin/interpret-trailers and trailer.c so callers can reuse a single in-process helper (used by git interpret-trailers, git commit and git tag). The final commit adds git rebase --trailer, currently supported with the merge backend only (rejecting apply-only scenarios and validating input early).

v7:
Rebased onto origin/master at v2.53.0-154-g7c02d39fc2.
Split out a new patch to parse --trailer with OPT_STRVEC in git commit and git tag.
Use strbuf_write() in interpret-trailers when emitting buffered output. Restore --in-place rewriting semantics via tempfile+rename.
Drop wrapper.c/h and validate trailer args via validate_trailer_args(). Drop redundant rebase basic-state save/restore for --trailer arguments.

v6: squash all fix commits and split refactor step from the original patch based on Phillip's suggestion and code [4].
v5: fix all Kristoffer's review comments from v4[3] in place and without new patches.
v4: fix all reviewer comments in v3. [2], and add patch 1~8 & 10~29 to fix review comments.
v3: merges the remaining trailer paths into one in-process helper, dropping the duplicate code, as pointed by Junio and Phillip [1]
v2: fix issues pointed by Phillip
RFC link:
https://lore.kernel.org/git/[email protected]/

Comments very very welcome!

[1]: https://lore.kernel.org/git/[email protected]/
[2]: https://lore.kernel.org/git/[email protected]/
[3]: https://lore.kernel.org/git/[email protected]/
[4]: https://lore.kernel.org/git/[email protected]/

Li Chen (5):
interpret-trailers: factor trailer rewriting
trailer: move process_trailers to trailer.h
trailer: append trailers without fork/exec
commit, tag: parse --trailer with OPT_STRVEC
rebase: support --trailer

 Documentation/git-rebase.adoc |   7 ++
 builtin/commit.c              |   3 +-
 builtin/interpret-trailers.c  |  47 ++-------
 builtin/rebase.c              |  18 ++++
 builtin/tag.c                 |   4 +-
 sequencer.c                   |  28 ++++++
 sequencer.h                   |   3 +
 t/meson.build                 |   1 +
 t/t3440-rebase-trailer.sh     | 147 ++++++++++++++++++++++++++++
 trailer.c                     | 179 ++++++++++++++++++++++++++++++++--
 trailer.h                     |  30 +++++-
 11 files changed, 414 insertions(+), 53 deletions(-)
 create mode 100755 t/t3440-rebase-trailer.sh
Signature · 1 line
2.52.0