Re: [PATCH] format-patch: assume --cover-letter for diff in multi-patch series
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 5, 2024, 18:58 UTC
- Message-ID
- <xmqqy17jqkre.fsf@gitster.g>
- In-Reply-To
- <xmqqbk4fs185.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 19 quoted lines
> Rubén Justo <rjusto@gmail.com> writes:
>
>> diff --git a/builtin/log.c b/builtin/log.c
>> index c8ce0c0d88..8032909d4f 100644
>> --- a/builtin/log.c
>> +++ b/builtin/log.c
>> @@ -2277,6 +2277,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
>> if (cover_letter == -1) {
>> if (config_cover_letter == COVER_AUTO)
>> cover_letter = (total > 1);
>> + else if ((idiff_prev.nr || rdiff_prev) && (total > 1))
>> + cover_letter = (config_cover_letter != COVER_OFF);
>> else
>> cover_letter = (config_cover_letter == COVER_ON);
>> }
>
> Interesting. So those who really really hate cover letters can set
> the configuration explicitly to 'off' and giving an --interdiff
> option would still have the sanity check kick in. Makes sense.This is not covered by the added tests, is it?
We need to test this case: the user asks for --interdiff but at the same time refuses with --no-cover-letter (or its config equivalent) to create a cover letter.
As I said already, everything else looked OK in this patch.
Thanks.