Re: [RFC/PATCH 2/3] mailinfo: correct malformed test example
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 16, 2016, 22:55 UTC
- Message-ID
- <xmqqbmznihe0.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <2bfc2fc7-f16b-6d51-7353-54d38353464a@google.com>
Jonathan Tan <jonathantanmy@google.com> writes:
Show 25 quoted lines
> On 09/16/2016 12:19 PM, Junio C Hamano wrote:
>> Jonathan Tan <jonathantanmy@google.com> writes:
>>
>>> An existing sample message (0015) in the tests for mailinfo contains an
>>> indented line immediately after an in-body header (without any
>>> intervening blank line).
>>
>> This comes from d25e5159 ("git am/mailinfo: Don't look at in-body
>> headers when rebasing", 2009-11-20), where we want to make sure that
>> a "From: bogosity" that isn't meant to be an in-body header is not
>> identified as such, even when it is immediately followed by a
>> non-blank line. "From: bogosity" is for msg0015 but the same
>> applies to the header-looking block for msg0008.
>>
>> Adding a blank line there will defeat the whole point of the test,
>> which is to make sure we don't do anything funky when --no-inbody-headers
>> is asked for, no?
>
> Before I revise the patch set...I think that the point of 0015 would
> be handled by 0008 (after this patch is applied), but if you prefer
> that 0015 retain its purpose, I can unindent the bullet list in 0015
> instead of adding the extra line (and then dropping all 0008
> changes). Would that be better? (0015 needs to be changed somehow,
> because its indented line would be interpreted as a continuation line
> after RFC/PATCH 3/3 is applied.)Hmph, these:
t/t5100/info0008--no-inbody-headers | 5 +++++ t/t5100/msg0008--no-inbody-headers | 6 ++++++ t/t5100/msg0015--no-inbody-headers | 1 +
have --no-inbody-headers in their names; wouldn't that an indication that they are expected output when mailinfo is run while in-body header feature disabled?
I would have expected that it would make more sense to make no change to sample.mbox and have updated expectation to outputs in the case where in-body header feature is enabled.
To make sure this new feature will not break in the future, we would want a brand new message with a folded in-body header added to the sample.mbox, and see how it is parsed by mailinfo with in-body header feature enabled (and disabled).