Re: [PATCH v2 06/15] rev-list: make --count work with --objects
- From
Jeff King <peff@peff.net>
- Date
- Feb 18, 2020, 19:59 UTC
- Message-ID
- <20200218195901.GB21774@coredump.intra.peff.net>
- In-Reply-To
- <3230c8c9-5208-3161-324e-c0ce948ee5b3@gmail.com>
On Tue, Feb 18, 2020 at 01:05:35PM -0500, Derrick Stolee wrote:
Show 20 quoted lines
> On 2/14/2020 1:22 PM, Jeff King wrote: > > +test_expect_success 'rev-list --count' ' > > + count=$(git rev-list --count HEAD) && > > + git rev-list HEAD >actual && > > + test_line_count = $count actual > > +' > > + > > +test_expect_success 'rev-list --count --objects' ' > > + count=$(git rev-list --count --objects HEAD) && > > + git rev-list --objects HEAD >actual && > > + test_line_count = $count actual > > +' > > I suppose these tests work, although I would probably > prefer precomputed explicit expected counts instead > of asking rev-list for the correct answer to a > rev-list command. This is still fine, because we test > that the non-count versions return the correct results, > but I would hate for a bug to affect both modes equally > and cause these tests to pass.
I was hoping it would make the tests a bit less brittle. And as you note, we should be checking the enumeration results themselves more carefully in other tests, so I find it fairly unlikely to see a bug that doesn't trigger _any_ test failure.
-Peff