{"thread":{"id":"1194","subject":"[PATCH] Make --recover cause pull to trace everything","startedAt":"2005-07-10T20:43:14Z","lastAt":"2005-07-10T20:43:14Z","messageCount":1,"participants":["Daniel Barkalow"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"5912","messageId":"Pine.LNX.4.21.0507101635160.30848-100000@iabervon.org","threadId":"1194","inReplyTo":null,"subject":"[PATCH] Make --recover cause pull to trace everything","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-07-10T20:43:14Z","receivedAt":"2005-07-10T20:43:14Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"Make the --recover flag check the parents of commits which are already\navailable. This is needed currently to deal with cases where a parent is\npulled along with a commit (in a pack, e.g.) and references above that\nparent aren't also pulled together.\n\nSigned-off-by: Daniel Barkalow <barkalow@iabervon.org>\n---\ncommit 75e8c1be7a778e0a0fa119fe1bc408341932e7e5\ntree ffbe708117543c356eb2981f1e0540b89b7a95e2\nparent a7336ae514738f159dad314d6674961427f043a6\nauthor Daniel Barkalow <barkalow@iabervon.org> 1121024019 -0400\ncommitter Daniel Barkalow <barkalow@silva-tulga.(none)> 1121024019 -0400\n\nIndex: http-pull.c\n===================================================================\n--- 248f72f3e4dcb40693488b0c06f93d0b38122b8e/http-pull.c  (mode:100644 sha1:1f9d60b9b1d5eed85b24d96c240666bbfc5a22ed)\n+++ ffbe708117543c356eb2981f1e0540b89b7a95e2/http-pull.c  (mode:100644 sha1:3fa56f08b0b8e7316afcaab3a7bfa3f2d26b550f)\n@@ -146,7 +146,10 @@\n \tint arg = 1;\n \n \twhile (arg < argc && argv[arg][0] == '-') {\n-\t\tif (argv[arg][1] == 't') {\n+\t\tif (argv[arg][1] == '-') {\n+\t\t\tif (!strcmp(argv[arg] + 2, \"recover\"))\n+\t\t\t\tcareful = 1;\n+\t\t} else if (argv[arg][1] == 't') {\n \t\t\tget_tree = 1;\n \t\t} else if (argv[arg][1] == 'c') {\n \t\t\tget_history = 1;\nIndex: local-pull.c\n===================================================================\n--- 248f72f3e4dcb40693488b0c06f93d0b38122b8e/local-pull.c  (mode:100644 sha1:2f06fbee8b840a7ae642f5a22e2cb993687f3470)\n+++ ffbe708117543c356eb2981f1e0540b89b7a95e2/local-pull.c  (mode:100644 sha1:0d10c07844030bc7cb615cf916dce89592151be7)\n@@ -116,7 +116,10 @@\n \tint arg = 1;\n \n \twhile (arg < argc && argv[arg][0] == '-') {\n-\t\tif (argv[arg][1] == 't')\n+\t\tif (argv[arg][1] == '-') {\n+\t\t\tif (!strcmp(argv[arg] + 2, \"recover\"))\n+\t\t\t\tcareful = 1;\n+\t\t} else if (argv[arg][1] == 't')\n \t\t\tget_tree = 1;\n \t\telse if (argv[arg][1] == 'c')\n \t\t\tget_history = 1;\nIndex: pull.c\n===================================================================\n--- 248f72f3e4dcb40693488b0c06f93d0b38122b8e/pull.c  (mode:100644 sha1:ed3078e3b27c62c07558fd94f339801cbd685593)\n+++ ffbe708117543c356eb2981f1e0540b89b7a95e2/pull.c  (mode:100644 sha1:d9763840c7ebcb1e5838c3b960695cafcca3ac73)\n@@ -11,6 +11,7 @@\n \n const unsigned char *current_ref = NULL;\n \n+int careful = 0;\n int get_tree = 0;\n int get_history = 0;\n int get_all = 0;\n@@ -91,7 +92,8 @@\n \tif (get_history) {\n \t\tstruct commit_list *parents = obj->parents;\n \t\tfor (; parents; parents = parents->next) {\n-\t\t\tif (has_sha1_file(parents->item->object.sha1))\n+\t\t\tif (!careful &&\n+\t\t\t    has_sha1_file(parents->item->object.sha1))\n \t\t\t\tcontinue;\n \t\t\tif (make_sure_we_have_it(NULL,\n \t\t\t\t\t\t parents->item->object.sha1)) {\nIndex: pull.h\n===================================================================\n--- 248f72f3e4dcb40693488b0c06f93d0b38122b8e/pull.h  (mode:100644 sha1:e173ae3337c4465da87d849f4e5c9da203fdf01d)\n+++ ffbe708117543c356eb2981f1e0540b89b7a95e2/pull.h  (mode:100644 sha1:d1076468b71b31dd5e59ec55d98de830cf9df60e)\n@@ -21,6 +21,12 @@\n /* If set, the hash that the current value of write_ref must be. */\n extern const unsigned char *current_ref;\n \n+/* \n+ * Set to check on everything, instead of stopping at points where we think\n+ * we must have everything.\n+ */\n+extern int careful;\n+\n /* Set to fetch the target tree. */\n extern int get_tree;\n \nIndex: ssh-pull.c\n===================================================================\n--- 248f72f3e4dcb40693488b0c06f93d0b38122b8e/ssh-pull.c  (mode:100644 sha1:26356dd7d84ea1bc9f7320b18562ed4117d4fac0)\n+++ ffbe708117543c356eb2981f1e0540b89b7a95e2/ssh-pull.c  (mode:100644 sha1:7ca4243f3bd84590e7bb94467fd5acccd7d4d6f9)\n@@ -61,7 +61,10 @@\n \tconst char *prog = getenv(\"GIT_SSH_PUSH\") ? : \"git-ssh-push\";\n \n \twhile (arg < argc && argv[arg][0] == '-') {\n-\t\tif (argv[arg][1] == 't') {\n+\t\tif (argv[arg][1] == '-') {\n+\t\t\tif (!strcmp(argv[arg] + 2, \"recover\"))\n+\t\t\t\tcareful = 1;\n+\t\t} else if (argv[arg][1] == 't') {\n \t\t\tget_tree = 1;\n \t\t} else if (argv[arg][1] == 'c') {\n \t\t\tget_history = 1;\n"}]}