git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Jeff KingNext: Patrick Steinhardt
Message 5 of 10 in “refs: remove lookup cache for reference-transaction hook”
  1. refs: remove lookup cache for reference-transaction hookPatrick Steinhardt, Aug 21, 2020
  2. Jeff KingAug 21, 2020
  3. Junio C HamanoAug 21, 2020
  4. Jeff KingAug 21, 2020
  5. Patrick SteinhardtAug 22, 2020
  6. Patrick SteinhardtAug 22, 2020
  7. refs: remove lookup cache for reference-transaction hookPatrick Steinhardt, Aug 25, 2020
  8. Jeff KingAug 25, 2020
  9. Junio C HamanoAug 25, 2020
  10. Jeff KingAug 25, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.