{"thread":{"id":"1798","subject":"[PATCH 1/4] Do not try to process objects more than once during fetch","startedAt":"2005-09-14T12:42:06Z","lastAt":"2005-09-15T19:31:24Z","messageCount":15,"participants":["Sergey Vlasov","Junio C Hamano","Linus Torvalds","Daniel Barkalow","Matthias Urlichs"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"8514","messageId":"20050914124206.GC24405@master.mivlgu.local","threadId":"1798","inReplyTo":null,"subject":"[PATCH 0/4] Recovery after interrupted HTTP(s) fetch","fromName":"Sergey Vlasov","fromEmail":"vsu@altlinux.ru","sentAt":"2005-09-14T12:42:06Z","receivedAt":"2005-09-14T12:42:06Z","isPatch":true,"sender":{"key":"vsu@altlinux.ru","avatar":"https://avatars.githubusercontent.com/u/616082?v=4"},"body":"Hello!\n\nThe current implementation of git-http-fetch, git-local-fetch,\ngit-ssh-fetch has a problem: if a fetch was interrupted in the middle,\nsome objects in the local repository will be missing, and there is no\neasy way to recover.  If you just attempt to repeat the fetch, it will\nnotice that you already have the most recent commit object, and will\nnot fetch anything more - the repository will stay broken.  Seems that\nthe only way to go forward is to prune the repository (which will\nremove the fetched objects, because they are not referenced) and\nrepeat the fetch again from the beginning, but this is obviously\nwasteful.\n\nThe problem is caused by the behavior of fetch.c:process_commit() - it\nskips parent commits which already exist locally.  This is a good\noptimization if your repository is OK, but after an interrupted fetch\nthere will be some missing objects in the object tree; the only way to\nfind them is to scan the whole tree, so stopping at the existing\ncommits is wrong.\n\nThis set of patches adds the recovery mode to git-*-fetch and the\ngit-fetch script, which is enabled by the --recover option; in this\nmode the program will walk through the whole object tree and try to\ndownload any missing objects.  Obviously, this could take some time,\nbut it is better than throwing away all already fetched objects after\nan error in the middle of a long fetch operation.\n\n-- \nSergey Vlasov\n"},{"id":"8513","messageId":"20050914124255.GD24405@master.mivlgu.local","threadId":"1798","inReplyTo":"20050914124206.GC24405@master.mivlgu.local","subject":"[PATCH 1/4] Do not try to process objects more than once during fetch","fromName":"Sergey Vlasov","fromEmail":"vsu@altlinux.ru","sentAt":"2005-09-14T12:42:55Z","receivedAt":"2005-09-14T12:42:55Z","isPatch":true,"sender":{"key":"vsu@altlinux.ru","avatar":"https://avatars.githubusercontent.com/u/616082?v=4"},"body":"fetch.c:process() is often called more than once for the same object;\ne.g., for unpacked git repository with 7313 objects there are 320997\ncalls to process() for objects which were already seen (and 7528 of\nthose calls are for tree objects, which is a real problem because of\nrecursive processing).\n\n---\n\n fetch.c |    8 ++++++++\n 1 files changed, 8 insertions(+), 0 deletions(-)\n\nf8285569e916a21c28379b55415165a89794272a\ndiff --git a/fetch.c b/fetch.c\n--- a/fetch.c\n+++ b/fetch.c\n@@ -7,6 +7,8 @@\n #include \"blob.h\"\n #include \"refs.h\"\n \n+#define SEEN\t\t(1u << 0)\n+\n const char *write_ref = NULL;\n \n const unsigned char *current_ref = NULL;\n@@ -126,6 +128,12 @@ static int process_object(struct object \n static int process(unsigned char *sha1, const char *type)\n {\n \tstruct object *obj = lookup_object_type(sha1, type);\n+\n+\t/* Do not try to process objects more than once */\n+\tif (obj->flags & SEEN)\n+\t\treturn 0;\n+\tobj->flags |= SEEN;\n+\n \tif (has_sha1_file(sha1)) {\n \t\tparse_object(sha1);\n \t\t/* We already have it, so we should scan it now. */\n"},{"id":"8515","messageId":"20050914124545.GE24405@master.mivlgu.local","threadId":"1798","inReplyTo":"20050914124206.GC24405@master.mivlgu.local","subject":"[PATCH 2/4] git-*-fetch: Gracefully recover from retrieval failure","fromName":"Sergey Vlasov","fromEmail":"vsu@altlinux.ru","sentAt":"2005-09-14T12:45:45Z","receivedAt":"2005-09-14T12:45:45Z","isPatch":true,"sender":{"key":"vsu@altlinux.ru","avatar":"https://avatars.githubusercontent.com/u/616082?v=4"},"body":"If the fetch process is interrupted in the middle after retrieving\nsome commits, there was no easy way to recover by re-running fetch,\nbecause fetch.c:process_commit() stops at commits which were already\nretrieved.\n\nThis patch adds the --recover option to git-*-fetch family; with this\noption git-*-fetch will walk the whole commit tree instead of stopping\nat existing commits, so that missing commits in the middle (and trees\nand blobs referenced by them) can be discovered and fetched.\n\n---\n\n This patch really requires \"[PATCH 1/4] Do not try to process objects\n more than once during fetch\" - otherwise commit objects are processed\n zillion times, and the fetch just never completes.\n\n\n Documentation/git-http-fetch.txt  |    3 +++\n Documentation/git-local-fetch.txt |    3 +++\n Documentation/git-ssh-fetch.txt   |    3 +++\n fetch.c                           |    4 +++-\n fetch.h                           |    6 ++++++\n http-fetch.c                      |    2 ++\n local-fetch.c                     |    2 ++\n ssh-fetch.c                       |    2 ++\n 8 files changed, 24 insertions(+), 1 deletions(-)\n\n2b0b8ebb6bba7ac390cccc35a026acf0c4ee6c56\ndiff --git a/Documentation/git-http-fetch.txt b/Documentation/git-http-fetch.txt\n--- a/Documentation/git-http-fetch.txt\n+++ b/Documentation/git-http-fetch.txt\n@@ -21,6 +21,9 @@ Downloads a remote GIT repository via HT\n \tGet trees associated with the commit objects.\n -a::\n \tGet all the objects.\n+--recover::\n+\tCheck all referenced commits instead of stopping at existing\n+\tones to recover after earlier fetch that was interrupted.\n -v::\n \tReport what is downloaded.\n \ndiff --git a/Documentation/git-local-fetch.txt b/Documentation/git-local-fetch.txt\n--- a/Documentation/git-local-fetch.txt\n+++ b/Documentation/git-local-fetch.txt\n@@ -23,6 +23,9 @@ OPTIONS\n \tGet trees associated with the commit objects.\n -a::\n \tGet all the objects.\n+--recover::\n+\tCheck all referenced commits instead of stopping at existing\n+\tones to recover after earlier fetch that was interrupted.\n -v::\n \tReport what is downloaded.\n \ndiff --git a/Documentation/git-ssh-fetch.txt b/Documentation/git-ssh-fetch.txt\n--- a/Documentation/git-ssh-fetch.txt\n+++ b/Documentation/git-ssh-fetch.txt\n@@ -31,6 +31,9 @@ commit-id::\n \tGet trees associated with the commit objects.\n -a::\n \tGet all the objects.\n+--recover::\n+\tCheck all referenced commits instead of stopping at existing\n+\tones to recover after earlier fetch that was interrupted.\n -v::\n \tReport what is downloaded.\n -w::\ndiff --git a/fetch.c b/fetch.c\n--- a/fetch.c\n+++ b/fetch.c\n@@ -16,6 +16,7 @@ const unsigned char *current_ref = NULL;\n int get_tree = 0;\n int get_history = 0;\n int get_all = 0;\n+int get_recover = 0;\n int get_verbosely = 0;\n static unsigned char current_commit_sha1[20];\n \n@@ -80,7 +81,8 @@ static int process_commit(struct commit \n \tif (get_history) {\n \t\tstruct commit_list *parents = commit->parents;\n \t\tfor (; parents; parents = parents->next) {\n-\t\t\tif (has_sha1_file(parents->item->object.sha1))\n+\t\t\tif (!get_recover &&\n+\t\t\t    has_sha1_file(parents->item->object.sha1))\n \t\t\t\tcontinue;\n \t\t\tif (process(parents->item->object.sha1,\n \t\t\t\t    commit_type))\ndiff --git a/fetch.h b/fetch.h\n--- a/fetch.h\n+++ b/fetch.h\n@@ -37,6 +37,12 @@ extern int get_history;\n /* Set to fetch the trees in the commit history. */\n extern int get_all;\n \n+/*\n+ * Set to walk the whole commit tree without stopping at commits we already\n+ * have (so that we could detect and fetch missing commits in the middle).\n+ */\n+extern int get_recover;\n+\n /* Set to be verbose */\n extern int get_verbosely;\n \ndiff --git a/http-fetch.c b/http-fetch.c\n--- a/http-fetch.c\n+++ b/http-fetch.c\n@@ -341,6 +341,8 @@ int main(int argc, char **argv)\n \t\t} else if (argv[arg][1] == 'w') {\n \t\t\twrite_ref = argv[arg + 1];\n \t\t\targ++;\n+\t\t} else if (!strcmp(argv[arg], \"--recover\")) {\n+\t\t\tget_recover = 1;\n \t\t}\n \t\targ++;\n \t}\ndiff --git a/local-fetch.c b/local-fetch.c\n--- a/local-fetch.c\n+++ b/local-fetch.c\n@@ -211,6 +211,8 @@ int main(int argc, char **argv)\n \t\t\tget_verbosely = 1;\n \t\telse if (argv[arg][1] == 'w')\n \t\t\twrite_ref = argv[++arg];\n+\t\telse if (!strcmp(argv[arg], \"--recover\"))\n+\t\t\tget_recover = 1;\n \t\telse\n \t\t\tusage(local_pull_usage);\n \t\targ++;\ndiff --git a/ssh-fetch.c b/ssh-fetch.c\n--- a/ssh-fetch.c\n+++ b/ssh-fetch.c\n@@ -106,6 +106,8 @@ int main(int argc, char **argv)\n \t\t} else if (argv[arg][1] == 'w') {\n \t\t\twrite_ref = argv[arg + 1];\n \t\t\targ++;\n+\t\t} else if (!strcmp(argv[arg], \"--recover\")) {\n+\t\t\tget_recover = 1;\n \t\t}\n \t\targ++;\n \t}\n"},{"id":"8516","messageId":"20050914124737.GF24405@master.mivlgu.local","threadId":"1798","inReplyTo":"20050914124206.GC24405@master.mivlgu.local","subject":"[PATCH 3/4] git-fetch: Add --recover option","fromName":"Sergey Vlasov","fromEmail":"vsu@altlinux.ru","sentAt":"2005-09-14T12:47:37Z","receivedAt":"2005-09-14T12:47:37Z","isPatch":true,"sender":{"key":"vsu@altlinux.ru","avatar":"https://avatars.githubusercontent.com/u/616082?v=4"},"body":"Make git-fetch accept the --recover option and pass it to\ngit-http-fetch (for other protocols this option is ignored).\n\n---\n\n I would add the documentation in the same patch, but noticed that\n other options of git-fetch were not documented, so I made a separate\n patch which documents all of them.\n\n\n git-fetch.sh |    6 +++++-\n 1 files changed, 5 insertions(+), 1 deletions(-)\n\ne19be8e89d20745918c76c4b587c286cef88d023\ndiff --git a/git-fetch.sh b/git-fetch.sh\n--- a/git-fetch.sh\n+++ b/git-fetch.sh\n@@ -8,6 +8,7 @@ _x40=\"$_x40$_x40$_x40$_x40$_x40$_x40$_x4\n append=\n force=\n update_head_ok=\n+recover_option=\n while case \"$#\" in 0) break ;; esac\n do\n \tcase \"$1\" in\n@@ -22,6 +23,9 @@ do\n \t--update-head-o|--update-head-ok)\n \t\tupdate_head_ok=t\n \t\t;;\n+\t-r|--r|--re|--rec|--reco|--recov|--recove|--recover)\n+\t\trecover_option=\"--recover\"\n+\t\t;;\n \t*)\n \t\tbreak\n \t\t;;\n@@ -179,7 +183,7 @@ do\n \texpr \"$head\" : \"$_x40\\$\" >/dev/null ||\n \t\tdie \"Failed to fetch $remote_name from $remote\"\n \techo Fetching \"$remote_name from $remote\" using http\n-\tgit-http-fetch -v -a \"$head\" \"$remote/\" || exit\n+\tgit-http-fetch -v -a $recover_option \"$head\" \"$remote/\" || exit\n \t;;\n     rsync://*)\n \tTMP_HEAD=\"$GIT_DIR/TMP_HEAD\"\n"},{"id":"8517","messageId":"20050914124805.GG24405@master.mivlgu.local","threadId":"1798","inReplyTo":"20050914124206.GC24405@master.mivlgu.local","subject":"[PATCH 4/4] Document git-fetch options","fromName":"Sergey Vlasov","fromEmail":"vsu@altlinux.ru","sentAt":"2005-09-14T12:48:05Z","receivedAt":"2005-09-14T12:48:05Z","isPatch":true,"sender":{"key":"vsu@altlinux.ru","avatar":"https://avatars.githubusercontent.com/u/616082?v=4"},"body":"Add documentation for git-fetch options (including the newly added\n--recover option).\n\n---\n\n Documentation/git-fetch.txt        |    6 ++++++\n Documentation/pull-fetch-param.txt |   19 +++++++++++++++++++\n 2 files changed, 25 insertions(+), 0 deletions(-)\n\n7685a3d50566e908fb8beb2ddb3088877aa9ae0f\ndiff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt\n--- a/Documentation/git-fetch.txt\n+++ b/Documentation/git-fetch.txt\n@@ -26,6 +26,12 @@ OPTIONS\n -------\n include::pull-fetch-param.txt[]\n \n+-u, \\--update-head-ok::\n+\tBy default 'git-fetch' refuses to update the head which\n+\tcorresponds to the current branch.  This flag disables the\n+\tcheck.  Note that fetching into the current branch will not\n+\tupdate the index and working directory, so use it with care.\n+\n \n Author\n ------\ndiff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt\n--- a/Documentation/pull-fetch-param.txt\n+++ b/Documentation/pull-fetch-param.txt\n@@ -80,3 +80,22 @@\n           <ref>: when pulling/fetching, and <ref>:<ref> when\n           pushing.  That is, do not store it locally if\n           fetching, and update the same name if pushing.\n+\n+-a, \\--append::\n+\tAppend ref names and object names of fetched refs to the\n+\texisting contents of $GIT_DIR/FETCH_HEAD.  Without this\n+\toption old data in $GIT_DIR/FETCH_HEAD will be overwritten.\n+\n+-f, \\--force::\n+\tUsually, the command refuses to update a local ref that is\n+\tnot an ancestor of the remote ref used to overwrite it.\n+\tThis flag disables the check.  What this means is that the\n+\tlocal repository can lose commits; use it with care.\n+\n+-r, \\--recover::\n+\tRecover after an interrupted fetch.  When fetching over\n+\tHTTP(s), this option is passed to 'git-http-fetch', which\n+\twill then walk through the whole commit tree and fetch all\n+\tmissing objects.  For other protocols this option is\n+\tignored, because they don't have problems with recovery\n+\tafter an interrupted fetch.\n"},{"id":"8544","messageId":"7vpsrbjz0t.fsf@assigned-by-dhcp.cox.net","threadId":"1798","inReplyTo":"20050914124206.GC24405@master.mivlgu.local","subject":"Re: [PATCH 0/4] Recovery after interrupted HTTP(s) fetch","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-09-14T18:16:18Z","receivedAt":"2005-09-14T18:16:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sergey Vlasov <vsu@altlinux.ru> writes:\n\n> The problem is caused by the behavior of fetch.c:process_commit() - it\n> skips parent commits which already exist locally.  This is a good\n> optimization if your repository is OK, but after an interrupted fetch\n> there will be some missing objects in the object tree; the only way to\n> find them is to scan the whole tree, so stopping at the existing\n> commits is wrong.\n\nHmph.  I could almost swear that I've seen the 'recovery' fix\nfrom Daniel and merged it some time ago -- but I do not see that\nin the git-whatchanged output.  The only '--recover' I see is\nthe leftover command line option description to recover from\ndelta-fetch failure, which would not happen because we do not\nhave deltified objects anymore.\n\nThanks for the patch.\n"},{"id":"8555","messageId":"Pine.LNX.4.58.0509141325310.26803@g5.osdl.org","threadId":"1798","inReplyTo":"7vpsrbjz0t.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 0/4] Recovery after interrupted HTTP(s) fetch","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-09-14T20:27:12Z","receivedAt":"2005-09-14T20:27:12Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 14 Sep 2005, Junio C Hamano wrote:\n> \n> Thanks for the patch.\n\nThis is wrong.\n\nAny \"fetch\" logic that writes the refs before all the objects are gathered \nis _buggy_. It's not about \"recovery\", it should never do that in the \nfirst place.\n\nIs it just the http one that is this broken?\n\n\t\tLinus\n"},{"id":"8558","messageId":"7vacifgyv2.fsf@assigned-by-dhcp.cox.net","threadId":"1798","inReplyTo":"Pine.LNX.4.58.0509141325310.26803@g5.osdl.org","subject":"Re: [PATCH 0/4] Recovery after interrupted HTTP(s) fetch","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-09-14T20:48:01Z","receivedAt":"2005-09-14T20:48:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@osdl.org> writes:\n\n> Any \"fetch\" logic that writes the refs before all the objects are gathered \n> is _buggy_. It's not about \"recovery\", it should never do that in the \n> first place.\n\nI agree about refs, but in this case what is stored, and is used\nas a signal not to refetch to the next run, is the commit\nobject.  Ideally we should defer creating trees until we store\nall blobs and subtrees, and commits until we do its tree, but\nthe fetch.c (formerly called pull.c) is not written that way\nfrom day one.\n\n> Is it just the http one that is this broken?\n\nI belive all of the commit walkers share this property.\n"},{"id":"8559","messageId":"Pine.LNX.4.63.0509141641290.23242@iabervon.org","threadId":"1798","inReplyTo":"Pine.LNX.4.58.0509141325310.26803@g5.osdl.org","subject":"Re: [PATCH 0/4] Recovery after interrupted HTTP(s) fetch","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-09-14T20:55:49Z","receivedAt":"2005-09-14T20:55:49Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Wed, 14 Sep 2005, Linus Torvalds wrote:\n\n> On Wed, 14 Sep 2005, Junio C Hamano wrote:\n> > \n> > Thanks for the patch.\n> \n> This is wrong.\n> \n> Any \"fetch\" logic that writes the refs before all the objects are gathered \n> is _buggy_. It's not about \"recovery\", it should never do that in the \n> first place.\n\nIt's not about the refs at all. The issue is that, when it reaches a \ncommit that we already have, it assumes that we have everything that \ncommit references and stops there. It really ought to not do that, but I \nthink it might be too slow if it goes through everything all the time. We \nprobably want to keep a cache listing some commits we have, and use that.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"8561","messageId":"Pine.LNX.4.58.0509141411510.26803@g5.osdl.org","threadId":"1798","inReplyTo":"Pine.LNX.4.63.0509141641290.23242@iabervon.org","subject":"Re: [PATCH 0/4] Recovery after interrupted HTTP(s) fetch","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-09-14T21:15:18Z","receivedAt":"2005-09-14T21:15:18Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 14 Sep 2005, Daniel Barkalow wrote:\n> \n> It's not about the refs at all. The issue is that, when it reaches a \n> commit that we already have, it assumes that we have everything that \n> commit references and stops there. It really ought to not do that, but I \n> think it might be too slow if it goes through everything all the time.\n\nNo, you don't need to go through everything all the time.\n\nDo what the pack-sending stuff does: it assumes that it has everything\nthat is reachable from the _old_ refs. It doesn't walk all the way to the \nroot, it \"just\" walks far enough that it can ignore anything that was \nreachable from the old refs.\n\nYes, it's slightly more complex than assuming \"oh, I have this object, so\nI must have all of its ancestors\", but it's a lot safer. Then the rule\njust becomes: only update refs once you've fetched all the objects.\n\n\t\tLinus\n"},{"id":"8562","messageId":"Pine.LNX.4.63.0509141722500.23242@iabervon.org","threadId":"1798","inReplyTo":"Pine.LNX.4.58.0509141411510.26803@g5.osdl.org","subject":"Re: [PATCH 0/4] Recovery after interrupted HTTP(s) fetch","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-09-14T21:24:16Z","receivedAt":"2005-09-14T21:24:16Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Wed, 14 Sep 2005, Linus Torvalds wrote:\n\n> On Wed, 14 Sep 2005, Daniel Barkalow wrote:\n> > \n> > It's not about the refs at all. The issue is that, when it reaches a \n> > commit that we already have, it assumes that we have everything that \n> > commit references and stops there. It really ought to not do that, but I \n> > think it might be too slow if it goes through everything all the time.\n> \n> No, you don't need to go through everything all the time.\n> \n> Do what the pack-sending stuff does: it assumes that it has everything\n> that is reachable from the _old_ refs. It doesn't walk all the way to the \n> root, it \"just\" walks far enough that it can ignore anything that was \n> reachable from the old refs.\n\nOh, right. Yeah, that's the obvious solution. I'll do that tonight.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"8564","messageId":"7vk6hjfh9u.fsf@assigned-by-dhcp.cox.net","threadId":"1798","inReplyTo":"Pine.LNX.4.63.0509141722500.23242@iabervon.org","subject":"Re: [PATCH 0/4] Recovery after interrupted HTTP(s) fetch","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-09-14T21:53:17Z","receivedAt":"2005-09-14T21:53:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Barkalow <barkalow@iabervon.org> writes:\n\n> On Wed, 14 Sep 2005, Linus Torvalds wrote:\n>\n>> Do what the pack-sending stuff does: it assumes that it has everything\n>> that is reachable from the _old_ refs. It doesn't walk all the way to the \n>> root, it \"just\" walks far enough that it can ignore anything that was \n>> reachable from the old refs.\n>\n> Oh, right. Yeah, that's the obvious solution. I'll do that tonight.\n\nThanks.  In the meantime I have Sergey's patch in the \"pu\"\nbranch but we can replace it with your fix.\n"},{"id":"8596","messageId":"pan.2005.09.15.10.34.59.363606@smurf.noris.de","threadId":"1798","inReplyTo":"7vk6hjfh9u.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 0/4] Recovery after interrupted HTTP(s) fetch","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-09-15T10:35:01Z","receivedAt":"2005-09-15T10:35:01Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi, Junio C Hamano wrote:\n\n> Daniel Barkalow <barkalow@iabervon.org> writes:\n>> Oh, right. Yeah, that's the obvious solution. I'll do that tonight.\n> \n> Thanks.  In the meantime I have Sergey's patch in the \"pu\"\n> branch but we can replace it with your fix.\n\nPersonally I'd rather combine the two. The point being, broken\nrepositories do happen -- for instance, when the file system is\ninconsistent after a crash, or when the referent of an info/alternates\ndirectory vanishes. :-/\n\nI'd rather have a simple repair flag than do a \"download everything again\nand then throw most of it away\" job when something like that happens.\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nExperience keeps a dear school, but it's a hell of a campaign tactic.\n\t\t\t\t\t-- Poor Jimmy's Almanac\n"},{"id":"8620","messageId":"Pine.LNX.4.63.0509151458240.23242@iabervon.org","threadId":"1798","inReplyTo":"pan.2005.09.15.10.34.59.363606@smurf.noris.de","subject":"Re: [PATCH 0/4] Recovery after interrupted HTTP(s) fetch","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-09-15T19:02:59Z","receivedAt":"2005-09-15T19:02:59Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Thu, 15 Sep 2005, Matthias Urlichs wrote:\n\n> Hi, Junio C Hamano wrote:\n> \n> > Daniel Barkalow <barkalow@iabervon.org> writes:\n> >> Oh, right. Yeah, that's the obvious solution. I'll do that tonight.\n> > \n> > Thanks.  In the meantime I have Sergey's patch in the \"pu\"\n> > branch but we can replace it with your fix.\n> \n> Personally I'd rather combine the two. The point being, broken\n> repositories do happen -- for instance, when the file system is\n> inconsistent after a crash, or when the referent of an info/alternates\n> directory vanishes. :-/\n> \n> I'd rather have a simple repair flag than do a \"download everything again\n> and then throw most of it away\" job when something like that happens.\n\nAgreed; but we want a new patch for --recover, because with the new code, \nthe easy way is to skip the for_each_ref call, at which point it will just \nnot assume you have anything.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"8624","messageId":"7vu0gmyvoz.fsf@assigned-by-dhcp.cox.net","threadId":"1798","inReplyTo":"pan.2005.09.15.10.34.59.363606@smurf.noris.de","subject":"Re: [PATCH 0/4] Recovery after interrupted HTTP(s) fetch","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-09-15T19:31:24Z","receivedAt":"2005-09-15T19:31:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthias Urlichs <smurf@smurf.noris.de> writes:\n\n> Personally I'd rather combine the two. The point being, broken\n> repositories do happen -- for instance, when the file system is\n> inconsistent after a crash, or when the referent of an info/alternates\n> directory vanishes. :-/\n>\n> I'd rather have a simple repair flag than do a \"download everything again\n> and then throw most of it away\" job when something like that happens.\n\nIf you are talking about disaster recovery, wouldn't you rather\nclone the remote into a clean repository, and fetch what are\nsalvageable from the potentially corrupt old repository into\nthis clean repository you know is OK?  I think that would\nsuggest that you do not need another \"download everything again\"\nadded to git-http-fetch.  You can already run git-clone from the\nremote to \"download everything again\", and then git-fetch from\nthe repository being salvaged.\n"}]}