Expand description
Cherry-pick / sign-off trailer handling compatible with Git’s sequencer.c and trailer.c.
Used when rewriting commit messages for cherry-pick -x / -s so spacing and trailer
detection match upstream tests (e.g. t3511-cherry-pick-x).
Structs§
- Trailer
Opts - Options parsed from a
%(trailers:...)pretty placeholder, mirroring Git’sprocess_trailer_optionsinpretty.c/trailer.c.
Functions§
- append_
cherry_ picked_ from_ line - Append
-xtrailer matchingsequencer.c(record_origin). - append_
signoff_ trailer - Append sign-off matching
append_signoffinsequencer.c(noAPPEND_SIGNOFF_DEDUP). - append_
signoff_ trailer_ with_ dedup - Append sign-off with optional
APPEND_SIGNOFF_DEDUP(set byformat-patch --signoff, which suppresses adding a sign-off that already exists anywhere in the trailer block, not just at the very end). - finalize_
cherry_ pick_ message - Apply
-x/-srewriting plus optionalcommit.cleanupwhen-xis set. - format_
signoff_ line - Build
Signed-off-by: Name <email>\nusing the same identity resolution as cherry-pick. - format_
trailers - Format the trailers of
msgaccording toopts, matching Git’sformat_trailers_from_commitused by the%(trailers:...)pretty placeholder. - message_
ends_ with_ trailer - Whether the final non-blank line of
msglooks like a trailer (pertrailer.crules fromconfig). Used to decide whether an appendedSigned-off-by:joins the existing trailer block (single\n) or starts a new paragraph (\n\n), matching Git’sappend_signoff.