{"thread":{"id":"12735","subject":"[PATCH] Fix tag following","startedAt":"2008-03-18T02:15:02Z","lastAt":"2008-03-19T00:28:19Z","messageCount":2,"participants":["Daniel Barkalow","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"72337","messageId":"alpine.LNX.1.00.0803172211060.19665@iabervon.org","threadId":"12735","inReplyTo":null,"subject":"[PATCH] Fix tag following","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-03-18T02:15:02Z","receivedAt":"2008-03-18T02:15:02Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"Before the second fetch-pack connection in the same process, unmark\nall of the objects marked in the first connection, in order that we'll\nlist them as things we have instead of thinking we've already\nmentioned them.\n\nSigned-off-by: Daniel Barkalow <barkalow@iabervon.org>\n---\nThis fixes David Brownell's test case, at least as far as failing to find \nany common commits. There's still some issue I haven't been able to track \ndown where it seems to list the same \"have\" values for refs the second \ntime, despite them having been updated, but that's a much much smaller \nissue.\n\n builtin-fetch-pack.c |   16 ++++++++++++++++\n 1 files changed, 16 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c\nindex 7b28024..65350ca 100644\n--- a/builtin-fetch-pack.c\n+++ b/builtin-fetch-pack.c\n@@ -26,6 +26,8 @@ static const char fetch_pack_usage[] =\n #define SEEN\t\t(1U << 3)\n #define POPPED\t\t(1U << 4)\n \n+static int marked;\n+\n /*\n  * After sending this many \"have\"s if we do not get any new ACK , we\n  * give up traversing our history.\n@@ -61,6 +63,16 @@ static int rev_list_insert_ref(const char *path, const unsigned char *sha1, int\n \treturn 0;\n }\n \n+static int clear_marks(const char *path, const unsigned char *sha1, int flag, void *cb_data)\n+{\n+\tstruct object *o = deref_tag(parse_object(sha1), path, 0);\n+\n+\tif (o && o->type == OBJ_COMMIT)\n+\t\tclear_commit_marks((struct commit *)o,\n+\t\t\t\t   COMMON | COMMON_REF | SEEN | POPPED);\n+\treturn 0;\n+}\n+\n /*\n    This function marks a rev and its ancestors as common.\n    In some cases, it is desirable to mark only the ancestors (for example\n@@ -153,6 +165,10 @@ static int find_common(int fd[2], unsigned char *result_sha1,\n \tunsigned in_vain = 0;\n \tint got_continue = 0;\n \n+\tif (marked)\n+\t\tfor_each_ref(clear_marks, NULL);\n+\tmarked = 1;\n+\n \tfor_each_ref(rev_list_insert_ref, NULL);\n \n \tfetching = 0;\n-- \n1.5.4.3.610.gea6cd\n"},{"id":"72425","messageId":"alpine.DEB.1.00.0803181952230.2071@eeepc-johanness","threadId":"12735","inReplyTo":"alpine.LNX.1.00.0803172211060.19665@iabervon.org","subject":"Re: [PATCH] Fix tag following","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-03-19T00:28:19Z","receivedAt":"2008-03-19T00:28:19Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 17 Mar 2008, Daniel Barkalow wrote:\n\n> Before the second fetch-pack connection in the same process, unmark all \n> of the objects marked in the first connection, in order that we'll list \n> them as things we have instead of thinking we've already mentioned them.\n\nThis patch is obviously correct, methinks.\n\nCiao,\nDscho\n"}]}