Re: [PATCH v2] test_cmp: diagnose incorrect arguments
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 10, 2020, 15:22 UTC
- Message-ID
- <xmqqtuxacyp8.fsf@gitster.c.googlers.com>
- In-Reply-To
- <CAPig+cTA_BVz-bGcGY++g2RV-Zd3Gv_yTGjv=VeMeqhP4eZZrw@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 7 quoted lines
> I had the same concern that it didn't necessarily make sense to allow > "-" for $2, but eventually thought of a case such as: > > sed '...' actual | test_cmp expect - && > > which massages 'actual' before test_cmp() sees it. True, we don't > actually have such callers, but it theoretically is legitimate.
Yup, that looks a bit too stretching [*] to me, but that was what I had in mind when I said "I'll let it pass".
Side note. Presumably that 'actual' was written by Git, to
avoid losing its exit code, e.g.git frotz >actual && sed '...' actual | test_cmp expect -
but then it becomes more natural to write the second one like
so:git frotz >raw && sed '...' raw >actual && test_cmp expect actual