{"thread":{"id":"1956","subject":"[PATCH] Implement --recover for git-*-fetch","startedAt":"2005-09-27T01:38:08Z","lastAt":"2005-09-27T01:38:08Z","messageCount":1,"participants":["Daniel Barkalow"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"9354","messageId":"Pine.LNX.4.63.0509262137360.23242@iabervon.org","threadId":"1956","inReplyTo":null,"subject":"[PATCH] Implement --recover for git-*-fetch","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-09-27T01:38:08Z","receivedAt":"2005-09-27T01:38:08Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"With the --recover option, we verify that we have absolutely\neverything reachable from the target, not assuming that things\nreachable from refs will be complete.\n\nSigned-off-by: Daniel Barkalow <barkalow@iabervon.org>\n---\n\n fetch.c       |    5 ++++-\n fetch.h       |    3 +++\n http-fetch.c  |    2 ++\n local-fetch.c |    2 ++\n ssh-fetch.c   |    2 ++\n 5 files changed, 13 insertions(+), 1 deletions(-)\n\n96e5339ec5759c716282465cb86e3e559270c51c\ndiff --git a/fetch.c b/fetch.c\n--- a/fetch.c\n+++ b/fetch.c\n@@ -15,6 +15,7 @@ int get_tree = 0;\n int get_history = 0;\n int get_all = 0;\n int get_verbosely = 0;\n+int get_recover = 0;\n static unsigned char current_commit_sha1[20];\n \n void pull_say(const char *fmt, const char *hex) \n@@ -214,7 +215,9 @@ int pull(char *target)\n \t\t\treturn -1;\n \t}\n \n-\tfor_each_ref(mark_complete);\n+\tif (!get_recover) {\n+\t\tfor_each_ref(mark_complete);\n+\t}\n \n \tif (interpret_target(target, sha1))\n \t\treturn error(\"Could not interpret %s as something to pull\",\ndiff --git a/fetch.h b/fetch.h\n--- a/fetch.h\n+++ b/fetch.h\n@@ -40,6 +40,9 @@ extern int get_all;\n /* Set to be verbose */\n extern int get_verbosely;\n \n+/* Set to check on all reachable objects. */\n+extern int get_recover;\n+\n /* Report what we got under get_verbosely */\n extern void pull_say(const char *, const char *);\n \ndiff --git a/http-fetch.c b/http-fetch.c\n--- a/http-fetch.c\n+++ b/http-fetch.c\n@@ -491,6 +491,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@@ -231,6 +231,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@@ -119,6 +119,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"}]}