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

Re: [RFC/PATCH] Ordering of remotes for fetch --all

From
Jeff King <peff@peff.net>
Date
Apr 25, 2016, 21:37 UTC
Message-ID
<20160425213720.GB11227@sigill.intra.peff.net>
In-Reply-To
<20160425211506.8421-1-mtzguido@gmail.com>
On Mon, Apr 25, 2016 at 11:15:05PM +0200, Guido Martínez wrote:
Show 13 quoted lines
> I run a server with several git mirrors, that are updated every hour. On
> that same server, users clone those projects and work on them. We use
> the local mirrors to reduce network load: the users can fetch from the
> mirror first (to get most of the objects with zero network cost) and
> then fetch the real remote (to make sure they're completely up to date).
> 
> I would like this to be configurable in each git working directory,
> so users can just configure the order they want and then just do "git
> remote update".
> 
> I'm aware one can get this behavior by editing .git/config and
> ordering the remotes as one wishes, but I find that very hacky and not
> scripting-friendly.
You can also define your own ordered groups, like:
  $ git config remotes.foo "one two three"
  $ git fetch foo 2>&1 | grep ^Fetching
  Fetching one
  Fetching two
  Fetching three

That's not _exactly_ the same, because you can't give a partial ordering of one high-priority remote and then say "all the rest, in whatever order you want", because there's no way to say "all the rest".

You _can_ say:
  git config remotes.foo "high-priority --all"

but the final "--all" will fetch from high-priority again. An alternative feature would be to teach remotes.* groups to cull duplicates, if that's not acceptable.

I don't have a strong opinion against your approach, though. Just exploring alternatives.

-Peff
Previous: Guido MartínezNext: Guido Martínez
Message 3 of 4 in “Ordering of remotes for fetch --all”
  1. Ordering of remotes for fetch --allGuido Martínez, Apr 25, 2016
  2. remote: add a fetching priority to each remoteGuido Martínez, Apr 25, 2016
  3. Jeff KingApr 25, 2016
  4. Guido MartínezApr 28, 2016

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.