{"thread":{"id":"9865","subject":"[PATCH 3/3] rev-list --bisect: Bisection \"distance\" clean up.","startedAt":"2007-09-15T11:00:16Z","lastAt":"2007-09-16T08:54:06Z","messageCount":4,"participants":["Christian Couder","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"53106","messageId":"20070915130016.eac885f4.chriscool@tuxfamily.org","threadId":"9865","inReplyTo":null,"subject":"[PATCH 3/3] rev-list --bisect: Bisection \"distance\" clean up.","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2007-09-15T11:00:16Z","receivedAt":"2007-09-15T11:00:16Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n builtin-rev-list.c |   18 +++++++-----------\n 1 files changed, 7 insertions(+), 11 deletions(-)\n\ndiff --git a/builtin-rev-list.c b/builtin-rev-list.c\nindex c2ce1fc..6ade3b7 100644\n--- a/builtin-rev-list.c\n+++ b/builtin-rev-list.c\n@@ -189,7 +189,7 @@ static int count_interesting_parents(struct commit *commit)\n \treturn count;\n }\n \n-static inline int halfway(struct commit_list *p, int distance, int nr)\n+static inline int halfway(struct commit_list *p, int nr)\n {\n \t/*\n \t * Don't short-cut something we are not going to return!\n@@ -202,8 +202,7 @@ static inline int halfway(struct commit_list *p, int distance, int nr)\n \t * 2 and 3 are halfway of 5.\n \t * 3 is halfway of 6 but 2 and 4 are not.\n \t */\n-\tdistance *= 2;\n-\tswitch (distance - nr) {\n+\tswitch (2 * weight(p) - nr) {\n \tcase -1: case 0: case 1:\n \t\treturn 1;\n \tdefault:\n@@ -322,7 +321,7 @@ static struct commit_list *find_bisection(struct commit_list *list,\n static struct commit_list *do_find_bisection(struct commit_list *list,\n \t\t\t\t\t     int nr, int *weights)\n {\n-\tint n, counted, distance;\n+\tint n, counted;\n \tstruct commit_list *p;\n \n \tcounted = 0;\n@@ -373,15 +372,13 @@ static struct commit_list *do_find_bisection(struct commit_list *list,\n \tfor (p = list; p; p = p->next) {\n \t\tif (p->item->object.flags & UNINTERESTING)\n \t\t\tcontinue;\n-\t\tn = weight(p);\n-\t\tif (n != -2)\n+\t\tif (weight(p) != -2)\n \t\t\tcontinue;\n-\t\tdistance = count_distance(p);\n+\t\tweight_set(p, count_distance(p));\n \t\tclear_distance(list);\n-\t\tweight_set(p, distance);\n \n \t\t/* Does it happen to be at exactly half-way? */\n-\t\tif (halfway(p, distance, nr))\n+\t\tif (halfway(p, nr))\n \t\t\treturn p;\n \t\tcounted++;\n \t}\n@@ -419,8 +416,7 @@ static struct commit_list *do_find_bisection(struct commit_list *list,\n \t\t\t\tweight_set(p, weight(q));\n \n \t\t\t/* Does it happen to be at exactly half-way? */\n-\t\t\tdistance = weight(p);\n-\t\t\tif (halfway(p, distance, nr))\n+\t\t\tif (halfway(p, nr))\n \t\t\t\treturn p;\n \t\t}\n \t}\n-- \n1.5.3.1.20.g2a16-dirty\n"},{"id":"53107","messageId":"Pine.LNX.4.64.0709151215090.28586@racer.site","threadId":"9865","inReplyTo":"20070915130016.eac885f4.chriscool@tuxfamily.org","subject":"Re: [PATCH 3/3] rev-list --bisect: Bisection \"distance\" clean up.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-09-15T11:15:52Z","receivedAt":"2007-09-15T11:15:52Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Christian,\n\nyou did not provide any meaningful commit message.  I feel that this would \nbe needed in this case, _especially_ since there was no cover letter to \ndescribe what the heck this patch series fixes.\n\nCiao,\nDscho\n"},{"id":"53109","messageId":"200709151347.43744.chriscool@tuxfamily.org","threadId":"9865","inReplyTo":"Pine.LNX.4.64.0709151215090.28586@racer.site","subject":"Re: [PATCH 3/3] rev-list --bisect: Bisection \"distance\" clean up.","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2007-09-15T11:47:43Z","receivedAt":"2007-09-15T11:47:43Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Hi Dscho,\n\nThese are a bunch of cleanup patchs that I had already sent.\n\nSee:\nhttp://thread.gmane.org/gmane.comp.version-control.git/54345\nhttp://thread.gmane.org/gmane.comp.version-control.git/54346\nhttp://thread.gmane.org/gmane.comp.version-control.git/54344\nhttp://thread.gmane.org/gmane.comp.version-control.git/54347\n\nYeah, I should have said it somewhere, sorry about that.\n\nChristian.\n\nLe samedi 15 septembre 2007, Johannes Schindelin a écrit :\n> Hi Christian,\n>\n> you did not provide any meaningful commit message.  I feel that this\n> would be needed in this case, _especially_ since there was no cover\n> letter to describe what the heck this patch series fixes.\n>\n> Ciao,\n> Dscho\n>\n>\n> -\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"53179","messageId":"7vfy1f56tt.fsf@gitster.siamese.dyndns.org","threadId":"9865","inReplyTo":"20070915130016.eac885f4.chriscool@tuxfamily.org","subject":"Re: [PATCH 3/3] rev-list --bisect: Bisection \"distance\" clean up.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-09-16T08:54:06Z","receivedAt":"2007-09-16T08:54:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <chriscool@tuxfamily.org> writes:\n\n> diff --git a/builtin-rev-list.c b/builtin-rev-list.c\n> index c2ce1fc..6ade3b7 100644\n> --- a/builtin-rev-list.c\n> +++ b/builtin-rev-list.c\n> @@ -189,7 +189,7 @@ static int count_interesting_parents(struct commit *commit)\n>  \treturn count;\n>  }\n>  \n> -static inline int halfway(struct commit_list *p, int distance, int nr)\n> +static inline int halfway(struct commit_list *p, int nr)\n>  {\n\nThis makes sense as we always call with \"distance = weight(p)\".\n\nBut is this three-patch series really needed?  We see this kind\nof clean-ups often as a prelude to a larger set of enhancements,\nbuilding up anticipation for smarter and more beautiful things\nto come, and seeing the series end here leaves me wondering\n\"Huh?  Is that it?\".\n\nNot that clean-up itself does not have any value, but still...\n"}]}