All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Andrei Rybak <rybak.a.v@gmail.com>
Cc: "SZEDER Gábor" <szeder.dev@gmail.com>,
	git@vger.kernel.org, "Kirill Smelkov" <kirr@nexedi.com>,
	"Jeff King" <peff@peff.net>
Subject: Re: [PATCH] t5310-pack-bitmaps: fix bogus 'pack-objects to file can use bitmap' test
Date: Thu, 16 Aug 2018 15:36:17 -0700	[thread overview]
Message-ID: <xmqqr2iyc526.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <4d6ffc81-a1e8-a60f-d53f-2ec159160fcd@gmail.com> (Andrei Rybak's message of "Thu, 16 Aug 2018 22:51:43 +0200")

Andrei Rybak <rybak.a.v@gmail.com> writes:

> On 14/08/18 13:47, SZEDER Gábor wrote:
>> ... both
>> invocations produce empty 'pack{a,b}.objects' files, and the
>> subsequent 'test_cmp' happily finds those two empty files identical.
>
> Is test_cmp ever used for empty files? Would it make sense for
> test_cmp to issue warning when an empty file is being compared?

Typically test_cmp is used to compare the actual output from a
dubious command being tested with the expected output from a
procedure that is known not to be broken (e.g. a run of 'echo', or a
'cat' of here-doc), so at least one side would not be empty.

The test done here is an odd case---it compares output from two
equally dubious processes that are being tested and sees if their
results match.

That said, since we have test_must_be_empty, we could forbid feeding
empty files to test_cmp, after telling everybody that a test that
expects an empty output must use test_must_be_empty.  I do not think
it is a terrible idea.

  reply	other threads:[~2018-08-16 22:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-14 11:47 [PATCH] t5310-pack-bitmaps: fix bogus 'pack-objects to file can use bitmap' test SZEDER Gábor
2018-08-14 21:49 ` Jeff King
2018-08-16 20:51 ` Andrei Rybak
2018-08-16 22:36   ` Junio C Hamano [this message]
2018-08-17 17:39     ` SZEDER Gábor
2018-08-17 19:27       ` Andrei Rybak
2018-08-17 20:09         ` Junio C Hamano
2018-08-19 17:50           ` Andrei Rybak
2018-08-19 20:32             ` Jeff King
2018-08-19 21:37               ` Andrei Rybak
2018-08-19 21:43                 ` Jeff King
2018-08-21 21:52                   ` Junio C Hamano
2018-08-17 20:15         ` SZEDER Gábor
2018-08-22 18:14   ` Matthew DeVore
2018-08-27 10:22 ` Kirill Smelkov
2018-08-27 23:04   ` Jeff King
2018-08-28  6:37     ` Kirill Smelkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqr2iyc526.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=kirr@nexedi.com \
    --cc=peff@peff.net \
    --cc=rybak.a.v@gmail.com \
    --cc=szeder.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.