{"thread":{"id":"256","subject":"RE: [3/5] Add http-pull","startedAt":"2005-04-22T23:34:35Z","lastAt":"2005-04-22T23:34:35Z","messageCount":1,"participants":["Luck, Tony"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"1357","messageId":"B8E391BBE9FE384DAA4C5C003888BE6F03541C6E@scsmsx401.amr.corp.intel.com","threadId":"256","inReplyTo":null,"subject":"RE: [3/5] Add http-pull","fromName":"Luck, Tony","fromEmail":"tony.luck@intel.com","sentAt":"2005-04-22T23:34:35Z","receivedAt":"2005-04-22T23:34:35Z","isPatch":false,"sender":{"key":"tony.luck@intel.com","avatar":"https://avatars.githubusercontent.com/u/5446021?v=4"},"body":"\n>But if you download 1000 files of the 1010 you need, and then your network\n>goes down, you will need to download those 1000 again when it comes back,\n>because you can't save them unless you have the full history. \n\nSo you could make the temporary object repository persistant between pulls\nto avoid reloading them across the wire.  Something like:\n\nget_commit(sha1)\n{\n\tif (sha1 in real_repo) -> done\n\tif (!(sha1 in tmp_repo))\n\t\tload sha1 to tmp_repo\n\tget_tree(sha1->tree)\n\tfor each parent\n\t\tget_commit(sha1->parent)\n\tmove sha1 from tmp_repo to real_repo\n}\n\nget_tree(sha1)\n{\n\tif (sha1 in real_repo) -> done\n\tif (!(sha1 in tmp_repo))\n\t\tload sha1 to tmp repo\n\tfor_each (sha1->entry) {\n\t  case blob: if (!sha1 in real_repo) load to real_repo\n\t  case tree: get_tree()\n\t}\n\tmove sha1 from tmp_repo to real_repo\n}\n\nThe \"load sha1 to xxx_repo\" needs to be smarter than my dumb wget\nbased script ... it must confirm the sha1 of the object being loaded\nbefore installing (even into the tmp_repo).\n\n-Tony\n\t\n"}]}