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

Re: git-retry tool or git.retry config (built-in implementation)?

From
Bagas Sanjaya <bagasdotme@gmail.com>
Date
Sep 26, 2023, 23:57 UTC
Message-ID
<ZRNv-n_VlIDPX0oi@debian.me>
In-Reply-To
<ZRMLNyHXoWOj6K-l@bilena>
On Tue, Sep 26, 2023 at 12:47:51PM -0400, Yaroslav Halchenko wrote:
Show 14 quoted lines
> Dear Git Gurus,
> 
> In DataLad (https://datalad.org) we are doing lots of automated cloning,
> fetching etc as part of our CI etc jobs.  Once in a while git operations
> fail [see e.g. 1], and beg us to retry but we need to know when to
> do so, and not do it upon every failed git invocation since some
> failures could be legit (repository is gone). While looking how others
> solve it we found
> https://stackoverflow.com/questions/35014012/git-retry-if-http-request-failed
> which pointed to tools like git-retry and later part of
> https://chromium.googlesource.com/infra/infra/+/HEAD/go/src/infra/tools/git/retry_regexp.go
> which serve as a collection of regexes to be on lookout for to retry.
> 
> Would that be the "best" strategy currently?  

Looking at the actual git_retry.py script [1], it really just wraps actual Git commands. IMO, git-retry(1) shell script as you mentioned only calls the python version, which adds another level of indirection (why not doing it in pure shell?).

AFAIK, to solve the retrying problem, we need to have a way to tell transport backend (curl/ssh) to resume transfer from the faulty point.

Show 6 quoted lines
> 
> As regex matching might eventually break whenever `git` changes
> anything in the output messages, I wondered if there could be a more
> robust internal implementation in git itself?  Similarly git-annex has
> annex.retry config setting which sets the count of retries for
> "retriable" operations.  
Do you use porcelain interfaces instead of plumbing ones?
Thanks.
[1]: https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/01d2cde990f22d409e74e239de7e4d347102d6f6/git_retry.py
-- 
An old man doll... just what I always wanted! - Clara
Previous: Yaroslav HalchenkoNext: Yaroslav Halchenko
Message 2 of 4 in “git-retry tool or git.retry config (built-in implementation)?”
  1. Yaroslav HalchenkoSep 26, 2023
  2. Bagas SanjayaSep 26, 2023
  3. Yaroslav HalchenkoSep 27, 2023
  4. Bagas SanjayaSep 27, 2023

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.