Re: [PATCH] refs: remove lookup cache for reference-transaction hook
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Aug 22, 2020, 09:02 UTC
- Message-ID
- <20200822090234.GC1069@ncase.pks.im>
- In-Reply-To
- <20200821172137.GA3261095@coredump.intra.peff.net>
On Fri, Aug 21, 2020 at 01:21:37PM -0400, Jeff King wrote:
Show 13 quoted lines
> On Fri, Aug 21, 2020 at 09:42:45AM -0700, Junio C Hamano wrote:
>
> > Jeff King <peff@peff.net> writes:
> >
> > > However, I wondered...
> > >
> > >> +test_perf "nonatomic push" '
> > >> + git push ./target-repo.git branch-{1..1000} &&
> > >> + git push --delete ./target-repo.git branch-{1..1000}
> > >> +'
> >
> > Is this a bash-and-ksh-only test? At least, the above would not try
> > to push 1000 branches with the version of dash I have.I didn't realize it's shell-specific behaviour, thanks for highlighting.
Show 16 quoted lines
> Heh, I was so focused on the "push" part of it that I didn't even look > carefully at the second half of the command-line. ;) > > I think pushing "refs/heads/branch-*" would work for pushing. For > deletion, though, I don't think we allow wildcards in the refspecs. > You could abuse pruning: > > git push --prune ../dst.git refs/heads/does-not-exist/*:refs/heads/* > > It also may be OK to just omit that half of the test. I think the > initial push exercises the case we care about. Though I guess we do run > the test repeatedly, so we might have to do: > > rm -rf dst.git && > git init dst.git && > git push dst.git refs/heads/branch-*
I'm not too keen to use `rm -rf && git init` as it muddies the subject under test a bit. I'll try to come up with a non-shell-specific version of this on Monday.
Patrick