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

Re: Client-side mirroring patches (v0)

From
Shawn O. Pearce <spearce@spearce.org>
Date
Nov 26, 2009, 00:58 UTC
Message-ID
<20091126005837.GN11919@spearce.org>
In-Reply-To
<1259143617-26580-1-git-send-email-sam@vilain.net>
Sam Vilain <sam@vilain.net> wrote:
> Hey folks, this is the first stage of git mirroring 
...
> Also there is the matter of falling over to the next mirror should one
> not be reachable, but then we're getting into C weaknesses really.
> Should I plan to do exception recovery using 'longjmp' ? 
Please don't use longjmp.

You'll have to change the code to not die() upon connection failure, but instead return an error code to the higher level which can locate another mirror and retry.

> Also the
> process should be interruptible and provide a user menu.  Again this
> seems like it would be very tedious and clumsy in C.  How do people
> manage?
With great pain.  :-)

To do a user menu you can do a simple interface like `git add -i` does, which just dumps the choices to stdout and a prompt for the user to enter their selection. If you want something more complex you need to link to curses or ncurses, which IIRC opens some issues with portablity, but lets you do a bit nicer interface on the tty.

-- 
Shawn.
Previous: Shawn O. PearceNext: Nanako Shiraishi
Message 7 of 8 in “Client-side mirroring patches (v0)”
  1. Sam VilainNov 25, 2009
  2. 1/4 remote: allow mirroring to be specified, and document settingsSam Vilain, Nov 25, 2009
  3. 2/4 fetch: try mirrors if selectedSam Vilain, Nov 25, 2009
  4. 3/4 fetch --use-mirror: don't fetch with 'autotags' for actual fetchSam Vilain, Nov 25, 2009
  5. 4/4 fetch: cleanup refs with --use-mirrorSam Vilain, Nov 25, 2009
  6. Shawn O. PearceNov 26, 2009
  7. Shawn O. PearceNov 26, 2009
  8. Nanako ShiraishiJan 1, 2010

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.