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

Re: [PATCH v2] refs: remove lookup cache for reference-transaction hook

From
Jeff King <peff@peff.net>
Date
Aug 25, 2020, 18:29 UTC
Message-ID
<20200825182922.GB1417288@coredump.intra.peff.net>
In-Reply-To
<xmqqd03e1tsd.fsf@gitster.c.googlers.com>
On Tue, Aug 25, 2020 at 11:09:54AM -0700, Junio C Hamano wrote:
Show 11 quoted lines
> >> +test_perf "nonatomic push" '
> >> +	git push ./target-repo.git $(test_seq 1000) &&
> >> +	git push --delete ./target-repo.git $(test_seq 1000)
> >>  '
> >
> > This works as far as Git is concerned, but "seq 1000" output with NULs
> > is 3893 bytes. I wonder if some platforms might run into command-line
> > limits there.
> 
> That was my thought when I saw the above as well.  In addition, I do
> not think it is a good idea to encourage digit-only refnames.
Good point. It gets hairy at four digits:
  $ git show 1000
  error: short SHA1 1000 is ambiguous
  hint: The candidates are:
  hint:   10000434d2 tree
  hint:   10007bcb9e tree
  hint:   10008a0e22 tree
  hint:   1000bdf512 tree
  hint:   1000dc2368 blob
  fatal: ambiguous argument '1000': unknown revision or path not in the working tree.

So I think if the test works it may be relying on the exact object ids that happen to be generated (which fortunately are at least deterministic these days, but it may be a trap waiting to spring for somebody later).

-Peff
Previous: Junio C Hamano
Message 10 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.