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

Re: optimising a push by fetching objects from nearby repos

From
Duy Nguyen <pclouds@gmail.com>
Date
May 10, 2014, 13:54 UTC
Message-ID
<CACsJy8DJq2e149wH6cQb4p1fQx9hubKQvxToMU8LLO+UmP+XmA@mail.gmail.com>
In-Reply-To
<536E2C19.3000202@gmail.com>
On Sat, May 10, 2014 at 8:39 PM, Sitaram Chamarty <sitaramc@gmail.com> wrote:
Show 18 quoted lines
> Hi,
>
> Is there a trick to optimising a push by telling the receiver to pick up
> missing objects from some other repo on its own server, to cut down even
> more on network traffic?
>
> So, hypothetically,
>
>     git push user@host:repo1 --look-for-objects-in=repo2
>
> I'm aware of the alternates mechanism, but that makes the dependency on
> the other repo sort-of permanent.  I'm looking for a temporary
> dependence, just for the duration of the push.  Naturally, the objects
> should be brought into the target repo for that to happen, except that
> this would be doing more from disk and less from the network.
>
> My gut says this isn't possible, and I've searched enough to almost be
> sure, but before I give up, I wanted to ask.

My feeling is it is possible, assuming that the target sees and reuses objects from repo2 already. Injecting an alternate repo at runtime should be possible. We exclude objects from sending at commit level, not object level. So after the initial exclusion, we may need to run the to-be-sent objects against the alternate repo to skip some more, but that should not cost much if repo2 is fully packed. The receiver always does the connectivity test. So if you make a mistake and specify repo3 instead, the receiver will reject the push and the target repo won't be corrupted.

-- 
Duy
Previous: Sitaram ChamartyNext: brian m. carlson
Message 2 of 13 in “optimising a push by fetching objects from nearby repos”
  1. Sitaram ChamartyMay 10, 2014
  2. Duy NguyenMay 10, 2014
  3. brian m. carlsonMay 10, 2014
  4. milkiMay 10, 2014
  5. brian m. carlsonMay 10, 2014
  6. Junio C HamanoMay 10, 2014
  7. Sitaram ChamartyMay 11, 2014
  8. Storm-Olsen, MariusMay 11, 2014
  9. Sitaram ChamartyMay 11, 2014
  10. Storm-Olsen, MariusMay 11, 2014
  11. Sitaram ChamartyMay 11, 2014
  12. Junio C HamanoMay 11, 2014
  13. Sitaram ChamartyMay 12, 2014

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.