git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] format-patch: show 0/1 and 1/1 for singleton patch with cover letter

From
Jacob Keller <jacob.keller@gmail.com>
Date
Aug 23, 2016, 22:44 UTC
Message-ID
<CA+P7+xrUnwxa9GqutKGcirrOLKysCn=RLaeMUpgtKF173VxHpA@mail.gmail.com>
In-Reply-To
<xmqqk2f7t8ra.fsf@gitster.mtv.corp.google.com>
On Tue, Aug 23, 2016 at 3:34 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 61 quoted lines
> Jacob Keller <jacob.e.keller@intel.com> writes:
>
>> diff --git a/builtin/log.c b/builtin/log.c
>> index 92dc34dcb0cc..49aa534f4a01 100644
>> --- a/builtin/log.c
>> +++ b/builtin/log.c
>> @@ -1676,16 +1676,16 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
>>               /* nothing to do */
>>               return 0;
>>       total = nr;
>> -     if (!keep_subject && auto_number && total > 1)
>> -             numbered = 1;
>> -     if (numbered)
>> -             rev.total = total + start_number - 1;
>>       if (cover_letter == -1) {
>>               if (config_cover_letter == COVER_AUTO)
>>                       cover_letter = (total > 1);
>>               else
>>                       cover_letter = (config_cover_letter == COVER_ON);
>>       }
>> +     if (!keep_subject && auto_number && (total > 1 || cover_letter))
>> +             numbered = 1;
>> +     if (numbered)
>> +             rev.total = total + start_number - 1;
>>
>>       if (!signature) {
>>               ; /* --no-signature inhibits all signatures */
>
> That sounds sensible.
>
>> diff --git a/t/t4021-format-patch-numbered.sh b/t/t4021-format-patch-numbered.sh
>> index 886494b58f67..ea0a388f0191 100755
>> --- a/t/t4021-format-patch-numbered.sh
>> +++ b/t/t4021-format-patch-numbered.sh
>> @@ -36,6 +36,11 @@ test_no_numbered() {
>>       test_num_no_numbered $1 2
>>  }
>>
>> +test_single_cover_letter_numbered() {
>> +     grep "^Subject: \[PATCH 0/1\]" $1 &&
>> +     grep "^Subject: \[PATCH 1/1\]" $1
>> +}
>> +
>>  test_single_numbered() {
>>       grep "^Subject: \[PATCH 1/1\]" $1
>>  }
>> @@ -50,6 +55,11 @@ test_expect_success 'single patch defaults to no numbers' '
>>       test_single_no_numbered patch0.single
>>  '
>>
>> +test_expect_success 'single patch with cover-letter defaults to numbers' '
>> +     git format-patch --cover-letter --stdout HEAD~1 >patch0.single &&
>> +     test_single_cover_letter_numbered patch0.single
>> +'
>
> The remaining and existing tests seems to expect that the result of
> each test is stored in a distinct file so that the output can be
> inspected after seeing a test failure without running the script
> with the "-i" option.  Perhaps rename this to patch0.single-cover or
> something?  The same for the overwriting of patch1 we can see below.
>
Hmm, ya. I'll rework that.

Thanks, Jake

Previous: Junio C Hamano
Message 3 of 3 in “format-patch: show 0/1 and 1/1 for singleton patch with cover letter”
  1. format-patch: show 0/1 and 1/1 for singleton patch with cover letterJacob Keller, Aug 23, 2016
  2. Junio C HamanoAug 23, 2016
  3. Jacob KellerAug 23, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.