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

Re: [RFC/PATCH 0/5] remote: eliminate remote->{fetch,push}_refspec and lazy parsing of refspecs

From
Jeff King <peff@peff.net>
Date
Jun 17, 2017, 12:33 UTC
Message-ID
<20170617123354.xolqjqdvofjtksll@sigill.intra.peff.net>
In-Reply-To
<CAM0VKj=1DiPZzGot34Ar9SQR8VWV8ugvzFhAMibnZ8d-4F+1QA@mail.gmail.com>
On Sat, Jun 17, 2017 at 02:25:39PM +0200, SZEDER Gábor wrote:
Show 7 quoted lines
> >>   - The same information is stored twice, wasting memory.
> >
> > True (but a few hundred bytes is nothing among friends ;-)
> 
> Indeed.  Even in my repos with close to 10k remotes the amount of
> memory wasted by the duplicated refspecs is not an problem, there are
> more pressing issues there.
This is sort of a side note, but I'm curious why you need 10k remotes.

We used to do this at GitHub as part of our fork storage (the shared repository had each fork as a remote). We fixed the quadratic issues like d0da003d5 (use a hashmap to make remotes faster, 2014-07-29). But even the linear work to read the config is noticeable (and hits you on every command, even ones that don't care about remotes). Now instead we pass the refspecs directly to fetch whenever move objects between the storage repos. They were the same for every remote anyway (and I'd guess that is true, too, of your 10k remotes).

-Peff
Previous: SZEDER GáborNext: Jeff King
Message 10 of 12 in “remote: eliminate remote->{fetch,push}_refspec and lazy parsing of refspecs”
  1. 0/5 remote: eliminate remote->{fetch,push}_refspec and lazy parsing of refspecsSZEDER Gábor, Jun 16, 2017
  2. 2/5 remote.c: don't pass copies of refspecs to add_{fetch,push}_refspec()SZEDER Gábor, Jun 16, 2017
  3. 4/5 remote.c: eliminate remote->fetch_refspecSZEDER Gábor, Jun 16, 2017
  4. 1/5 remote: don't use remote->{fetch,push}_refspecSZEDER Gábor, Jun 16, 2017
  5. Junio C HamanoJun 16, 2017
  6. 3/5 remote.c: extract a helper function to parse a single refspecSZEDER Gábor, Jun 16, 2017
  7. 5/5 remote.c: eliminate remote->push_refspecSZEDER Gábor, Jun 16, 2017
  8. Junio C HamanoJun 16, 2017
  9. SZEDER GáborJun 17, 2017
  10. Jeff KingJun 17, 2017
  11. Jeff KingJun 17, 2017
  12. Junio C HamanoJun 19, 2017

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.