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

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

From
GMGuido Martínez <mtzguido@gmail.com>
Date
Apr 25, 2016, 21:15 UTC
Message-ID
<20160425211506.8421-1-mtzguido@gmail.com>
Hi all,

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.

This patch introduces a fetch priority for each remote, at a default of 50 and modifiable via git config. This new order will only matter when doing fetch --all.

Do you think this is a useful feature? Hopefully you don't consider this as just noise :)

(As a side note: for ordering the remotes a stable sort would be best, to have the least impact possible on current behavior. I believe git_qsort is stable but a confirmation would be nice.)

Thanks! Guido

Guido Martínez (1):
  remote: add a fetching priority to each remote
 Documentation/config.txt |  5 +++++
 builtin/fetch.c          |  2 +-
 remote.c                 | 43 +++++++++++++++++++++++++++++++++++++++----
 remote.h                 |  2 ++
 4 files changed, 47 insertions(+), 5 deletions(-)
-- 
2.8.1.281.g0994585
Next: Guido Martínez
Message 1 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.