From: Junio C Hamano Date: Fri, 21 Sep 2018 16:45:11 GMT Subject: Re: [PATCH 3/3] transport.c: introduce core.alternateRefsPrefixes Message-ID: In-Reply-To: <20180921140732.GA43093@syl> Taylor Blau writes: > ...' block with your suggestion above. It's tempting to introduce it as: > > expect_haves() { > printf "%s .have\n" $(git rev-parse -- $@) > } > > And call it as: > > expect_haves one three two >expect > > But I'm not sure whether I think that this is better or worse than > writing it twice inline. If the expected pattern is expected to stay to be just a sequence of " .have" and nothing else for the foreseeable future, I think it is a good idea to introduce such a helper function. Spelling it out at the use site, e.g. printf "%s .have\n" $(git rev-parse a b c) >expect will become cumbersome once the set of objects you need to show starts growing. expect_haves a b c >expect would be shorter, of course. And as long as we expect to have ONLY " .have" lines and nothing else, there is no downside that the details of the format is hidden away inside the helper.