{"thread":{"id":"19642","subject":"[PATCH 2/4] bisect: use the skip ratio to choose a commit away from a skipped commit","startedAt":"2009-06-02T20:16:29Z","lastAt":"2009-06-03T07:10:12Z","messageCount":10,"participants":["Christian Couder","Junio C Hamano","H. Peter Anvin"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"115275","messageId":"20090602200731.3630.33652.chriscool@tuxfamily.org","threadId":"19642","inReplyTo":null,"subject":"[PATCH 0/4] make it possible to skip away from broken commits","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-06-02T20:16:29Z","receivedAt":"2009-06-02T20:16:29Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"This patch series adds a \"--ratio=x/y\" option to \"git bisect skip\" so\nthat it is possible to skip away from an area were the commits cannot\nbe tested.\n\nNote that in this series \"--ratio=4\" means the same as \"--ratio=1/4\".\nBut I am not sure if this shortcut is worth it.\n\nAfter this series I plan to implement a similar \"--skip-ratio\" option\nthat can be passed to \"git bisect start\" and to add some documentation.\n\n  bisect: add parameters to \"filter_skipped\"\n  bisect: use the skip ratio to choose a commit away from a skipped\n    commit\n  bisect: add \"--ratio=<ratio>\" option to \"git bisect skip\"\n  t6030: add test case for \"git bisect skip --ratio=x/y\"\n\n bisect.c                    |   74 ++++++++++++++++++++++++++++++++++++++++--\n bisect.h                    |    4 ++-\n builtin-rev-list.c          |    4 ++-\n git-bisect.sh               |   37 ++++++++++++++-------\n t/t6030-bisect-porcelain.sh |   12 +++++++\n 5 files changed, 112 insertions(+), 19 deletions(-)\n"},{"id":"115276","messageId":"20090602201634.3630.11702.chriscool@tuxfamily.org","threadId":"19642","inReplyTo":"20090602200731.3630.33652.chriscool@tuxfamily.org","subject":"[PATCH 1/4] bisect: add parameters to \"filter_skipped\"","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-06-02T20:16:30Z","receivedAt":"2009-06-02T20:16:30Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"because we will need to get more information from this function in\nsome later patches.\n\nThe new \"int *count\" parameter gives the number of commits left after\nthe skipped commit have been filtered out.\n\nThe new \"int *skipped_first\" parameter tells us if the first commit\nin the list has been skipped. Note that using this parameter also\nchanges the behavior of the function if the first commit is indeed\nskipped. Because we assume that in this case we will want all the\nfiltered commits, not just the first one, even if \"show_all\" is not\nset.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n bisect.c           |   26 ++++++++++++++++++++++----\n bisect.h           |    4 +++-\n builtin-rev-list.c |    4 +++-\n 3 files changed, 28 insertions(+), 6 deletions(-)\n\ndiff --git a/bisect.c b/bisect.c\nindex 2a273f3..5e5a248 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -523,12 +523,19 @@ static char *join_sha1_array_hex(struct sha1_array *array, char delim)\n \n struct commit_list *filter_skipped(struct commit_list *list,\n \t\t\t\t   struct commit_list **tried,\n-\t\t\t\t   int show_all)\n+\t\t\t\t   int show_all,\n+\t\t\t\t   int *count,\n+\t\t\t\t   int *skipped_first)\n {\n \tstruct commit_list *filtered = NULL, **f = &filtered;\n \n \t*tried = NULL;\n \n+\tif (skipped_first)\n+\t\t*skipped_first = 0;\n+\tif (count)\n+\t\t*count = 0;\n+\n \tif (!skipped_revs.sha1_nr)\n \t\treturn list;\n \n@@ -537,19 +544,30 @@ struct commit_list *filter_skipped(struct commit_list *list,\n \t\tlist->next = NULL;\n \t\tif (0 <= lookup_sha1_array(&skipped_revs,\n \t\t\t\t\t   list->item->object.sha1)) {\n+\t\t\tif (skipped_first && !*skipped_first)\n+\t\t\t\t*skipped_first = 1;\n \t\t\t/* Move current to tried list */\n \t\t\t*tried = list;\n \t\t\ttried = &list->next;\n \t\t} else {\n-\t\t\tif (!show_all)\n-\t\t\t\treturn list;\n+\t\t\tif (!show_all) {\n+\t\t\t\tif (!skipped_first || !*skipped_first)\n+\t\t\t\t\treturn list;\n+\t\t\t} else if (skipped_first && !*skipped_first) {\n+\t\t\t\t*skipped_first = -1;\n+\t\t\t}\n \t\t\t/* Move current to filtered list */\n \t\t\t*f = list;\n \t\t\tf = &list->next;\n+\t\t\tif (count)\n+\t\t\t\t(*count)++;\n \t\t}\n \t\tlist = next;\n \t}\n \n+\tif (skipped_first && *skipped_first == -1)\n+\t\t*skipped_first = 0;\n+\n \treturn filtered;\n }\n \n@@ -909,7 +927,7 @@ int bisect_next_all(const char *prefix, const char *skip_ratio)\n \n \trevs.commits = find_bisection(revs.commits, &reaches, &all,\n \t\t\t\t       !!skipped_revs.sha1_nr);\n-\trevs.commits = filter_skipped(revs.commits, &tried, 0);\n+\trevs.commits = filter_skipped(revs.commits, &tried, 0, NULL, NULL);\n \n \tif (!revs.commits) {\n \t\t/*\ndiff --git a/bisect.h b/bisect.h\nindex 6808389..6ac0ff5 100644\n--- a/bisect.h\n+++ b/bisect.h\n@@ -7,7 +7,9 @@ extern struct commit_list *find_bisection(struct commit_list *list,\n \n extern struct commit_list *filter_skipped(struct commit_list *list,\n \t\t\t\t\t  struct commit_list **tried,\n-\t\t\t\t\t  int show_all);\n+\t\t\t\t\t  int show_all,\n+\t\t\t\t\t  int *count,\n+\t\t\t\t\t  int *skipped_first);\n \n extern void print_commit_list(struct commit_list *list,\n \t\t\t      const char *format_cur,\ndiff --git a/builtin-rev-list.c b/builtin-rev-list.c\nindex 73bff84..69753dc 100644\n--- a/builtin-rev-list.c\n+++ b/builtin-rev-list.c\n@@ -262,7 +262,9 @@ int show_bisect_vars(struct rev_list_info *info, int reaches, int all)\n \tif (!revs->commits && !(flags & BISECT_SHOW_TRIED))\n \t\treturn 1;\n \n-\trevs->commits = filter_skipped(revs->commits, &tried, flags & BISECT_SHOW_ALL);\n+\trevs->commits = filter_skipped(revs->commits, &tried,\n+\t\t\t\t       flags & BISECT_SHOW_ALL,\n+\t\t\t\t       NULL, NULL);\n \n \t/*\n \t * revs->commits can reach \"reaches\" commits among\n-- \n1.6.3.GIT\n"},{"id":"115272","messageId":"20090602201634.3630.89985.chriscool@tuxfamily.org","threadId":"19642","inReplyTo":"20090602200731.3630.33652.chriscool@tuxfamily.org","subject":"[PATCH 2/4] bisect: use the skip ratio to choose a commit away from a skipped commit","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-06-02T20:16:31Z","receivedAt":"2009-06-02T20:16:31Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"To do that a new function \"apply_skip_ratio\" is added and another\nfunction \"managed_skipped\" is created to wrap both \"filter_skipped\"\nand the previous one.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n bisect.c |   50 +++++++++++++++++++++++++++++++++++++++++++++++++-\n 1 files changed, 49 insertions(+), 1 deletions(-)\n\ndiff --git a/bisect.c b/bisect.c\nindex 5e5a248..0a50cba 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -571,6 +571,53 @@ struct commit_list *filter_skipped(struct commit_list *list,\n \treturn filtered;\n }\n \n+static struct commit_list *apply_skip_ratio(struct commit_list *list,\n+\t\t\t\t\t    int count,\n+\t\t\t\t\t    int skip_num, int skip_denum)\n+{\n+\tint index, i;\n+\tstruct commit_list *cur, *previous;\n+\n+\tcur = list;\n+\tprevious = NULL;\n+\tindex = count * skip_num / skip_denum;\n+\n+\tfor (i = 0; cur; cur = cur->next, i++) {\n+\t\tif (i == index) {\n+\t\t\tif (hashcmp(cur->item->object.sha1, current_bad_sha1))\n+\t\t\t\treturn cur;\n+\t\t\tif (previous)\n+\t\t\t\treturn previous;\n+\t\t\treturn list;\n+\t\t}\n+\t\tprevious = cur;\n+\t}\n+\n+\treturn list;\n+}\n+\n+static struct commit_list *managed_skipped(struct commit_list *list,\n+\t\t\t\t\t   struct commit_list **tried,\n+\t\t\t\t\t   int skip_num, int skip_denum)\n+{\n+\tint count, skipped_first;\n+\n+\t*tried = NULL;\n+\n+\tif (!skipped_revs.sha1_nr)\n+\t\treturn list;\n+\n+\tif (!skip_num)\n+\t\treturn filter_skipped(list, tried, 0, NULL, NULL);\n+\n+\tlist = filter_skipped(list, tried, 0, &count, &skipped_first);\n+\n+\tif (!skipped_first)\n+\t\treturn list;\n+\n+\treturn apply_skip_ratio(list, count, skip_num, skip_denum);\n+}\n+\n static void bisect_rev_setup(struct rev_info *revs, const char *prefix,\n \t\t\t     const char *bad_format, const char *good_format,\n \t\t\t     int read_paths)\n@@ -927,7 +974,8 @@ int bisect_next_all(const char *prefix, const char *skip_ratio)\n \n \trevs.commits = find_bisection(revs.commits, &reaches, &all,\n \t\t\t\t       !!skipped_revs.sha1_nr);\n-\trevs.commits = filter_skipped(revs.commits, &tried, 0, NULL, NULL);\n+\trevs.commits = managed_skipped(revs.commits, &tried,\n+\t\t\t\t       skip_num, skip_denum);\n \n \tif (!revs.commits) {\n \t\t/*\n-- \n1.6.3.GIT\n"},{"id":"115273","messageId":"20090602201634.3630.25125.chriscool@tuxfamily.org","threadId":"19642","inReplyTo":"20090602200731.3630.33652.chriscool@tuxfamily.org","subject":"[PATCH 3/4] bisect: add \"--ratio=<ratio>\" option to \"git bisect skip\"","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-06-02T20:16:32Z","receivedAt":"2009-06-02T20:16:32Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"This option will be passed to \"git bisect--helper\" using its\n\"--skip-ratio\" option.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n git-bisect.sh |   37 ++++++++++++++++++++++++-------------\n 1 files changed, 24 insertions(+), 13 deletions(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 8969553..176b21d 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -9,7 +9,7 @@ git bisect bad [<rev>]\n         mark <rev> a known-bad revision.\n git bisect good [<rev>...]\n         mark <rev>... known-good revisions.\n-git bisect skip [(<rev>|<range>)...]\n+git bisect skip [--ratio=<ratio>] [(<rev>|<range>)...]\n         mark <rev>... untestable revisions.\n git bisect next\n         find next bisection to test and check it out.\n@@ -178,18 +178,27 @@ check_expected_revs() {\n }\n \n bisect_skip() {\n-        all=''\n-\tfor arg in \"$@\"\n+\tall=''\n+\tunset BISECT_SKIP_RATIO\n+\twhile [ $# -gt 0 ]\n \tdo\n-\t    case \"$arg\" in\n-            *..*)\n-                revs=$(git rev-list \"$arg\") || die \"Bad rev input: $arg\" ;;\n-            *)\n-                revs=$(git rev-parse --sq-quote \"$arg\") ;;\n-\t    esac\n-            all=\"$all $revs\"\n-        done\n-        eval bisect_state 'skip' $all\n+\t\targ=\"$1\"\n+\t\tcase \"$arg\" in\n+\t\t--ratio)\n+\t\t\tshift; BISECT_SKIP_RATIO=\"$1\" ;;\n+\t\t--ratio=*)\n+\t\t\tBISECT_SKIP_RATIO=$(expr \"$arg\" : '--ratio=\\(.*\\)') ;;\n+\t\t*..*)\n+\t\t\trevs=$(git rev-list \"$arg\") ||\n+\t\t\tdie \"Bad rev input: $arg\"\n+\t\t\tall=\"$all $revs\" ;;\n+\t\t*)\n+\t\t\trevs=$(git rev-parse --sq-quote \"$arg\")\n+\t\t\tall=\"$all $revs\" ;;\n+\t\tesac\n+\t\tshift\n+\tdone\n+\teval bisect_state 'skip' $all\n }\n \n bisect_state() {\n@@ -270,8 +279,10 @@ bisect_next() {\n \tbisect_autostart\n \tbisect_next_check good\n \n+\tskip_ratio=\"${BISECT_SKIP_RATIO+--skip-ratio=$BISECT_SKIP_RATIO}\"\n+\n \t# Perform all bisection computation, display and checkout\n-\tgit bisect--helper --next-all\n+\tgit bisect--helper --next-all $skip_ratio\n \tres=$?\n \n         # Check if we should exit because bisection is finished\n-- \n1.6.3.GIT\n"},{"id":"115274","messageId":"20090602201634.3630.34948.chriscool@tuxfamily.org","threadId":"19642","inReplyTo":"20090602200731.3630.33652.chriscool@tuxfamily.org","subject":"[PATCH 4/4] t6030: add test case for \"git bisect skip --ratio=x/y\"","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-06-02T20:16:33Z","receivedAt":"2009-06-02T20:16:33Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n t/t6030-bisect-porcelain.sh |   12 ++++++++++++\n 1 files changed, 12 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\nindex 5254b23..79956e5 100755\n--- a/t/t6030-bisect-porcelain.sh\n+++ b/t/t6030-bisect-porcelain.sh\n@@ -555,6 +555,18 @@ test_expect_success 'restricting bisection on one dir and a file' '\n \tgrep \"$PARA_HASH4 is first bad commit\" my_bisect_log.txt\n '\n \n+test_expect_success 'skipping with skip ratio' '\n+\tgit bisect start $PARA_HASH7 $HASH1 &&\n+\tpara4=$(git rev-parse --verify HEAD) &&\n+\ttest \"$para4\" = \"$PARA_HASH4\" &&\n+        git bisect skip --ratio=1/2 &&\n+\thash7=$(git rev-parse --verify HEAD) &&\n+\ttest \"$hash7\" = \"$HASH7\" &&\n+        git bisect skip --ratio=3 &&\n+\tpara6=$(git rev-parse --verify HEAD) &&\n+\ttest \"$para6\" = \"$PARA_HASH6\"\n+'\n+\n #\n #\n test_done\n-- \n1.6.3.GIT\n"},{"id":"115280","messageId":"7vmy8qe4ru.fsf@alter.siamese.dyndns.org","threadId":"19642","inReplyTo":"20090602200731.3630.33652.chriscool@tuxfamily.org","subject":"Re: [PATCH 0/4] make it possible to skip away from broken commits","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-02T20:53:41Z","receivedAt":"2009-06-02T20:53:41Z","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> This patch series adds a \"--ratio=x/y\" option to \"git bisect skip\" so\n> that it is possible to skip away from an area were the commits cannot\n> be tested.\n>\n> Note that in this series \"--ratio=4\" means the same as \"--ratio=1/4\".\n> But I am not sure if this shortcut is worth it.\n\nActually my gut feeling is that a tweakable knob itself is worth it,\nbecause the user can never tell what the right value should be.\n\nEspecially without any documentation updates that explains what this ratio\nrefers to ;-), but I suspect, unless the user is very familiar with how\nthe revision graph bisection internally works, such an explanation would\nnot help him find a skip ratio that is closer to the optimum than a random\nguess.  Why not use a constant ratio (or perhaps a pair of alternating\nratios) on \"bisect skip\" without any new options?\n"},{"id":"115312","messageId":"4A25EA85.5090208@zytor.com","threadId":"19642","inReplyTo":"7vmy8qe4ru.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 0/4] make it possible to skip away from broken commits","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2009-06-03T03:14:13Z","receivedAt":"2009-06-03T03:14:13Z","isPatch":true,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Junio C Hamano wrote:\n> Christian Couder <chriscool@tuxfamily.org> writes:\n> \n>> This patch series adds a \"--ratio=x/y\" option to \"git bisect skip\" so\n>> that it is possible to skip away from an area were the commits cannot\n>> be tested.\n>>\n>> Note that in this series \"--ratio=4\" means the same as \"--ratio=1/4\".\n>> But I am not sure if this shortcut is worth it.\n> \n> Actually my gut feeling is that a tweakable knob itself is worth it,\n> because the user can never tell what the right value should be.\n> \n> Especially without any documentation updates that explains what this ratio\n> refers to ;-), but I suspect, unless the user is very familiar with how\n> the revision graph bisection internally works, such an explanation would\n> not help him find a skip ratio that is closer to the optimum than a random\n> guess.  Why not use a constant ratio (or perhaps a pair of alternating\n> ratios) on \"bisect skip\" without any new options?\n> \n\nI would agree with this assessment.  It's hard enough to teach a user\nhow to use \"git bisect\" as it is... and being able to have a *user*\nbisect a problem is worth its weight in gold.\n\nIf the algorithm I proposed earlier is too complex, here is a very\nsimple approximation:\n\nstart:\n\tnum = 1\n\tden = 2\n\nagain:\n\trun test (num/den)\n\tif (!skip)\n\t\tgoto start\n\n\tnum = num + 2\n\tif (num > den)\t\n\t\tnum = 1\n\t\tden = den * 2\n\n\tgoto again\n\n\nThis creates test ratios in the following sequence:\n\n1/2 1/4 3/4 1/8 3/8 5/8 7/8 1/16 3/16 ...\n\nWhen one gets down to a small number of points this could get weird, but\nas long as skip points are filtered (which looks like it's already being\n done) it should converge.\n\nThis is almost certainly suboptimal, because there are at least two\npossibilities as to which is better, and this isn't either:\n\na) one should seek points closer to the periphery, because the\nlikelihood of a contiguous skip region goes down.\n\n1/2 1/4 3/4 1/8 7/8 1/16 15/16 ...\n\nb) one should seek points closer to the center in the hope of getting\nmore information; this is better on the assumption that skip points are\ngenerally scattered:\n\n1/2 1/4 3/4 3/8 5/8 1/8 7/8 7/16 9/16 5/16 11/16 ...\n\nHowever, as before, I think there is every reason to believe something\nlike that should be plenty good enough.\n\n\t-hpa\n\n-- \nH. Peter Anvin, Intel Open Source Technology Center\nI work for Intel.  I don't speak on their behalf.\n"},{"id":"115317","messageId":"200906030829.48470.chriscool@tuxfamily.org","threadId":"19642","inReplyTo":"7vmy8qe4ru.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 0/4] make it possible to skip away from broken commits","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-06-03T06:29:48Z","receivedAt":"2009-06-03T06:29:48Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Le Tuesday 02 June 2009, Junio C Hamano a écrit :\n> Christian Couder <chriscool@tuxfamily.org> writes:\n> > This patch series adds a \"--ratio=x/y\" option to \"git bisect skip\" so\n> > that it is possible to skip away from an area were the commits cannot\n> > be tested.\n> >\n> > Note that in this series \"--ratio=4\" means the same as \"--ratio=1/4\".\n> > But I am not sure if this shortcut is worth it.\n>\n> Actually my gut feeling is that a tweakable knob itself is worth it,\n> because the user can never tell what the right value should be.\n\nYou mean a boolean configuration variable like \"bisect.skip_away\" or \na \"--skip_away\" switch to \"git bisect start\" or both?\n\n> Especially without any documentation updates that explains what this\n> ratio refers to ;-), but I suspect, unless the user is very familiar with\n> how the revision graph bisection internally works, such an explanation\n> would not help him find a skip ratio that is closer to the optimum than a\n> random guess.  Why not use a constant ratio (or perhaps a pair of\n> alternating ratios) on \"bisect skip\" without any new options?\n\nOk, I will have a look at that too.\n\nThanks,\nChristian.\n"},{"id":"115318","messageId":"200906030832.01898.chriscool@tuxfamily.org","threadId":"19642","inReplyTo":"4A25EA85.5090208@zytor.com","subject":"Re: [PATCH 0/4] make it possible to skip away from broken commits","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-06-03T06:32:01Z","receivedAt":"2009-06-03T06:32:01Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Le Wednesday 03 June 2009, H. Peter Anvin a écrit :\n> Junio C Hamano wrote:\n> > Christian Couder <chriscool@tuxfamily.org> writes:\n> >> This patch series adds a \"--ratio=x/y\" option to \"git bisect skip\" so\n> >> that it is possible to skip away from an area were the commits cannot\n> >> be tested.\n> >>\n> >> Note that in this series \"--ratio=4\" means the same as \"--ratio=1/4\".\n> >> But I am not sure if this shortcut is worth it.\n> >\n> > Actually my gut feeling is that a tweakable knob itself is worth it,\n> > because the user can never tell what the right value should be.\n> >\n> > Especially without any documentation updates that explains what this\n> > ratio refers to ;-), but I suspect, unless the user is very familiar\n> > with how the revision graph bisection internally works, such an\n> > explanation would not help him find a skip ratio that is closer to the\n> > optimum than a random guess.  Why not use a constant ratio (or perhaps\n> > a pair of alternating ratios) on \"bisect skip\" without any new options?\n>\n> I would agree with this assessment.  It's hard enough to teach a user\n> how to use \"git bisect\" as it is... and being able to have a *user*\n> bisect a problem is worth its weight in gold.\n>\n> If the algorithm I proposed earlier is too complex, here is a very\n> simple approximation:\n>\n> start:\n> \tnum = 1\n> \tden = 2\n>\n> again:\n> \trun test (num/den)\n> \tif (!skip)\n> \t\tgoto start\n>\n> \tnum = num + 2\n> \tif (num > den)\n> \t\tnum = 1\n> \t\tden = den * 2\n>\n> \tgoto again\n>\n>\n> This creates test ratios in the following sequence:\n>\n> 1/2 1/4 3/4 1/8 3/8 5/8 7/8 1/16 3/16 ...\n>\n> When one gets down to a small number of points this could get weird, but\n> as long as skip points are filtered (which looks like it's already being\n>  done) it should converge.\n\nI agree. I will have a look.\n\nThanks,\nChristian.\n"},{"id":"115321","messageId":"7vbpp5dc8b.fsf@alter.siamese.dyndns.org","threadId":"19642","inReplyTo":"4A25EA85.5090208@zytor.com","subject":"Re: [PATCH 0/4] make it possible to skip away from broken commits","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-03T07:10:12Z","receivedAt":"2009-06-03T07:10:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"H. Peter Anvin\" <hpa@zytor.com> writes:\n\n> Junio C Hamano wrote:\n>> Christian Couder <chriscool@tuxfamily.org> writes:\n>> \n>>> This patch series adds a \"--ratio=x/y\" option to \"git bisect skip\" so\n>>> that it is possible to skip away from an area were the commits cannot\n>>> be tested.\n>>>\n>>> Note that in this series \"--ratio=4\" means the same as \"--ratio=1/4\".\n>>> But I am not sure if this shortcut is worth it.\n>> \n>> Actually my gut feeling is that a tweakable knob itself is worth it,\n\nI meant \"is not\" worth it.\n\n>> because the user can never tell what the right value should be.\n>> \n>> ...  Why not use a constant ratio (or perhaps a pair of alternating\n>> ratios) on \"bisect skip\" without any new options?\n>\n> I would agree with this assessment....\n\nThanks for reading what I meant to say, even though I said quite opposite\nto what I meant to say ;-)\n\n> When one gets down to a small number of points this could get weird, but\n> as long as skip points are filtered (which looks like it's already being\n> done) it should converge.\n\nYes; I think \"the next point\" selection after \"skip\" is (or at least can\nbe handled as) a local thing.  As long as the next point selection is not\ntoo close to the known-to-be-untestable commit we will have a reasonable\ncoverage over the remainder of the history.  Also I suspect that trying to\nbe too clever will not help us very much and the end result would be\naffected more heavily by the distribution of untestable commits than how\nwell these next points are chosen.\n"}]}