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

Re: [PATCH] Make object creation in http fetch a bit safer.

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Sep 21, 2005, 15:55 UTC
Message-ID
<Pine.LNX.4.63.0509211140230.23242@iabervon.org>
In-Reply-To
<7vd5n2ycbe.fsf@assigned-by-dhcp.cox.net>
On Wed, 21 Sep 2005, Junio C Hamano wrote:
> Unlike write_sha1_file() that tries to create the object file in a
> temporary location and then move it to the final location, fetch_object
> could have been interrupted in the middle, leaving a corrupt file.

Looks fine to me, although it should possibly share the code somehow with write_sha1_file().

Show 6 quoted lines
>  I think the packfile side is safer -- the index is verified
>  with the call to parse_pack_index() which eventually calls
>  check_packed_git_idx() to validate it, and the pack file is
>  checked when it is first used, just like any pack file we
>  originally had.  Ideally, we should validate the pair after
>  downloading with git-verify-pack, though.

Well, with verify_pack(), anyway. No need to prepare a command line, fork, exec, and parse it, just to call a library function.

I think we want to have the partial file in the destination location, and maybe teach http-fetch about resuming the download, since it takes significant time to download a single pack, and it would be nice to be able to use the part we've got if we get interrupted.

	-Daniel
*This .sig left intentionally blank*
Previous: Junio C Hamano
Message 2 of 2 in “Make object creation in http fetch a bit safer.”
  1. Make object creation in http fetch a bit safer.Junio C Hamano, Sep 21, 2005
  2. Daniel BarkalowSep 21, 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.