Re: [PATCH 1/2] repack: respect kept objects with '--write-midx -b'
- From
Jeff King <peff@peff.net>
- Date
- Dec 20, 2021, 13:50 UTC
- Message-ID
- <YcCKQEpBbdgbAKrk@coredump.intra.peff.net>
- In-Reply-To
- <d10662af-4ce9-6944-aa73-ef344f6bdf67@gmail.com>
On Mon, Dec 20, 2021 at 08:40:09AM -0500, Derrick Stolee wrote:
Show 15 quoted lines
> > One could perhaps argue that the combined grep is less readable. If
> > that's a concern, I'd suggest wrapping it in a function like:
> >
> > # usage: check_trace2_arg <trace_file> <cmd> <arg>
> > check_trace2_arg () {
> > grep "\"event\":\"start\".*\"$2\".*\"$3\"" "$1"
> > }
> >
> > All just suggestions, of course. I'd be happy enough to see the patch go
> > in as-is.
>
> Thanks for the suggestions. I decided to adapt the 'test_subcommand'
> helper into a 'test_subcommand_inexact' helper. The existing helper
> requires the full argument list in exact order, but the new one only
> cares about the given arguments (in that relative order).Heh, I should have looked to see if we had faced this problem before. Extending that family of helpers is better still than my suggestion.
-Peff