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

RE: [3/5] Add http-pull

From
Luck, Tony <tony.luck@intel.com>
Date
Apr 22, 2005, 23:34 UTC
Message-ID
<B8E391BBE9FE384DAA4C5C003888BE6F03541C6E@scsmsx401.amr.corp.intel.com>
>But if you download 1000 files of the 1010 you need, and then your network
>goes down, you will need to download those 1000 again when it comes back,
>because you can't save them unless you have the full history. 

So you could make the temporary object repository persistant between pulls to avoid reloading them across the wire. Something like:

get_commit(sha1)
{
	if (sha1 in real_repo) -> done
	if (!(sha1 in tmp_repo))
		load sha1 to tmp_repo
	get_tree(sha1->tree)
	for each parent
		get_commit(sha1->parent)
	move sha1 from tmp_repo to real_repo
}
get_tree(sha1)
{
	if (sha1 in real_repo) -> done
	if (!(sha1 in tmp_repo))
		load sha1 to tmp repo
	for_each (sha1->entry) {
	  case blob: if (!sha1 in real_repo) load to real_repo
	  case tree: get_tree()
	}
	move sha1 from tmp_repo to real_repo
}

The "load sha1 to xxx_repo" needs to be smarter than my dumb wget based script ... it must confirm the sha1 of the object being loaded before installing (even into the tmp_repo).

-Tony
	
Message 1 of 1 in “RE: [3/5] Add http-pull”
  1. Luck, TonyApr 22, 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.