git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC/PATCH] Ordering of remotes for fetch --all
@ 2016-04-25 21:15 Guido Martínez
  2016-04-25 21:15 ` [RFC/PATCH] remote: add a fetching priority to each remote Guido Martínez
  2016-04-25 21:37 ` [RFC/PATCH] Ordering of remotes for fetch --all Jeff King
  0 siblings, 2 replies; 4+ messages in thread
From: Guido Martínez @ 2016-04-25 21:15 UTC (permalink / raw)
  To: git; +Cc: Guido Martínez

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-28 15:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-25 21:15 [RFC/PATCH] Ordering of remotes for fetch --all Guido Martínez
2016-04-25 21:15 ` [RFC/PATCH] remote: add a fetching priority to each remote Guido Martínez
2016-04-25 21:37 ` [RFC/PATCH] Ordering of remotes for fetch --all Jeff King
2016-04-28 15:24   ` Guido Martínez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).