Subject: Re: [PATCH v7 5/5] rebase: support --trailer

From: "Kristoffer Haugsbakk" <[email-masked]>
Date: Tue, 03 Mar 2026 21:36:53 +0100

On Tue, Mar 3, 2026, at 16:05, Phillip Wood wrote:
>>[snip]
>> diff --git a/sequencer.c b/sequencer.c
>> index a3eb39bb25..a60c2a0cde 100644
>> --- a/sequencer.c
>> +++ b/sequencer.c
>> [...]
>> @@ -2025,6 +2027,9 @@ static int append_squash_message(struct strbuf *buf, const char *body,
>>   		if (opts->signoff)
>>   			append_signoff(buf, 0, 0);
>>
>> +		if (opts->trailer_args.nr)
>> +			amend_strbuf_with_trailers(buf, &opts->trailer_args);
>
> I wonder if it would be better to add the trailers before the signoff so
> that "git rebase --signoff --trailer='Reviewed-by: ...'" adds the
> "Reviewed-by:" trailer before the "Signed-off-by:" trailer.

Why is that? Is that because that is the practice in this project (and
maybe others)?

I would expect it to act like however `--trailer` already acts on
git-commit(1) and git-tag(1). I would have to test that.

In any case these `--signoff` options are considered a historical
mistake now (since they special-case one key).

The logic for before/after and so on are supposed to be handled by the
trailer config, it seems. But last I looked that was only for same-key
trailers and duplicates. Not for logic like keeping your own signoff
last.

>[snip]