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

[PATCH 0/4] Recovery after interrupted HTTP(s) fetch

From
Sergey Vlasov <vsu@altlinux.ru>
Date
Sep 14, 2005, 12:42 UTC
Message-ID
<20050914124206.GC24405@master.mivlgu.local>
Hello!

The current implementation of git-http-fetch, git-local-fetch, git-ssh-fetch has a problem: if a fetch was interrupted in the middle, some objects in the local repository will be missing, and there is no easy way to recover. If you just attempt to repeat the fetch, it will notice that you already have the most recent commit object, and will not fetch anything more - the repository will stay broken. Seems that the only way to go forward is to prune the repository (which will remove the fetched objects, because they are not referenced) and repeat the fetch again from the beginning, but this is obviously wasteful.

The problem is caused by the behavior of fetch.c:process_commit() - it skips parent commits which already exist locally. This is a good optimization if your repository is OK, but after an interrupted fetch there will be some missing objects in the object tree; the only way to find them is to scan the whole tree, so stopping at the existing commits is wrong.

This set of patches adds the recovery mode to git-*-fetch and the git-fetch script, which is enabled by the --recover option; in this mode the program will walk through the whole object tree and try to download any missing objects. Obviously, this could take some time, but it is better than throwing away all already fetched objects after an error in the middle of a long fetch operation.

-- 
Sergey Vlasov
Next: Sergey Vlasov
Message 1 of 15 in “Recovery after interrupted HTTP(s) fetch”
  1. 0/4 Recovery after interrupted HTTP(s) fetchSergey Vlasov, Sep 14, 2005
  2. 1/4 Do not try to process objects more than once during fetchSergey Vlasov, Sep 14, 2005
  3. 2/4 git-*-fetch: Gracefully recover from retrieval failureSergey Vlasov, Sep 14, 2005
  4. 3/4 git-fetch: Add --recover optionSergey Vlasov, Sep 14, 2005
  5. 4/4 Document git-fetch optionsSergey Vlasov, Sep 14, 2005
  6. Junio C HamanoSep 14, 2005
  7. Linus TorvaldsSep 14, 2005
  8. Junio C HamanoSep 14, 2005
  9. Daniel BarkalowSep 14, 2005
  10. Linus TorvaldsSep 14, 2005
  11. Daniel BarkalowSep 14, 2005
  12. Junio C HamanoSep 14, 2005
  13. Matthias UrlichsSep 15, 2005
  14. Daniel BarkalowSep 15, 2005
  15. Junio C HamanoSep 15, 2005

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.