{"thread":{"id":"16434","subject":"[RFC/PATCH] bisect: teach \"skip\" to accept special arguments like \"A..B\"","startedAt":"2008-11-23T21:02:49Z","lastAt":"2008-11-26T05:42:26Z","messageCount":5,"participants":["Christian Couder","Johannes Schindelin","Johannes Sixt","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"96389","messageId":"20081123220249.2e7f30a5.chriscool@tuxfamily.org","threadId":"16434","inReplyTo":null,"subject":"[RFC/PATCH] bisect: teach \"skip\" to accept special arguments like \"A..B\"","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2008-11-23T21:02:49Z","receivedAt":"2008-11-23T21:02:49Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"The current \"git bisect skip\" syntax is \"git bisect skip [<rev>...]\"\nso it's already possible to skip a range of revisions using\nsomething like:\n\n$ git bisect skip $(git rev-list A..B)\n\nwhere A and B are the bounds of the range we want to skip.\n\nThis patch teaches \"git bisect skip\" to accept:\n\n$ git bisect skip A..B\n\nas an abbreviation for the former command.\n\nThis is done by checking each argument to see if it contains two\ndots one after the other ('..'), and by expending it using\n\"git rev-list\" if that is the case.\n\nNote that this patch will not make \"git bisect skip\" accept all\nthat \"git rev-list\" accepts, as things like \"^A B\" for exemple\nwill not work. But things like \"A B..C D E F.. ..G H...I\" should\nwork as expected.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n git-bisect.sh |   19 ++++++++++++++++++-\n 1 files changed, 18 insertions(+), 1 deletions(-)\n\n\tDscho wrote:\n\t> Would it not be more intuitive to have support for\n\t>\n        > git bisect skip A..B\n\t>\n\t> ?\n\n\tHere is a patch to do that. I am not sure it's worth it\n\tbecause this is a special case in many ways.\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 0d0e278..6706bc1 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -191,6 +191,21 @@ check_expected_revs() {\n \tdone\n }\n \n+bisect_skip() {\n+        all=''\n+\tfor arg in \"$@\"\n+\tdo\n+\t    case \"$arg\" in\n+            *..*)\n+                revs=$(git rev-list \"$arg\") || die \"Bad rev input: $arg\" ;;\n+            *)\n+                revs=\"'$arg'\" ;;\n+\t    esac\n+            all=\"$all $revs\"\n+        done\n+        bisect_state 'skip' $all\n+}\n+\n bisect_state() {\n \tbisect_autostart\n \tstate=$1\n@@ -630,8 +645,10 @@ case \"$#\" in\n         git bisect -h ;;\n     start)\n         bisect_start \"$@\" ;;\n-    bad|good|skip)\n+    bad|good)\n         bisect_state \"$cmd\" \"$@\" ;;\n+    skip)\n+        bisect_skip \"$@\" ;;\n     next)\n         # Not sure we want \"next\" at the UI level anymore.\n         bisect_next \"$@\" ;;\n-- \n1.6.0.4.768.g22eb.dirty\n"},{"id":"96392","messageId":"alpine.DEB.1.00.0811240126430.30769@pacific.mpi-cbg.de","threadId":"16434","inReplyTo":"20081123220249.2e7f30a5.chriscool@tuxfamily.org","subject":"Re: [RFC/PATCH] bisect: teach \"skip\" to accept special arguments like \"A..B\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-11-24T00:28:05Z","receivedAt":"2008-11-24T00:28:05Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 23 Nov 2008, Christian Couder wrote:\n\n> The current \"git bisect skip\" syntax is \"git bisect skip [<rev>...]\"\n> so it's already possible to skip a range of revisions using\n> something like:\n> \n> $ git bisect skip $(git rev-list A..B)\n> \n> where A and B are the bounds of the range we want to skip.\n> \n> This patch teaches \"git bisect skip\" to accept:\n> \n> $ git bisect skip A..B\n> \n> as an abbreviation for the former command.\n> \n> This is done by checking each argument to see if it contains two\n> dots one after the other ('..'), and by expending it using\n> \"git rev-list\" if that is the case.\n\ns/expend/expand/\n\n> Note that this patch will not make \"git bisect skip\" accept all\n> that \"git rev-list\" accepts, as things like \"^A B\" for exemple\n> will not work. But things like \"A B..C D E F.. ..G H...I\" should\n> work as expected.\n> \n> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n> ---\n>  git-bisect.sh |   19 ++++++++++++++++++-\n>  1 files changed, 18 insertions(+), 1 deletions(-)\n> \n> \tDscho wrote:\n> \t> Would it not be more intuitive to have support for\n> \t>\n>         > git bisect skip A..B\n> \t>\n> \t> ?\n> \n> \tHere is a patch to do that. I am not sure it's worth it\n> \tbecause this is a special case in many ways.\n\nWhy not have something like\n\n\tskip)\n\t\tfor arg in $(git rev-list \"$@\")\n\t\tdo\n\t\t\tbisect_state skip $arg\n\t\tdone\n\n?\n\nCiao,\nDscho"},{"id":"96404","messageId":"492A5346.1040405@viscovery.net","threadId":"16434","inReplyTo":"alpine.DEB.1.00.0811240126430.30769@pacific.mpi-cbg.de","subject":"Re: [RFC/PATCH] bisect: teach \"skip\" to accept special arguments like \"A..B\"","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-11-24T07:09:58Z","receivedAt":"2008-11-24T07:09:58Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Johannes Schindelin schrieb:\n> On Sun, 23 Nov 2008, Christian Couder wrote:\n>> \tDscho wrote:\n>> \t> Would it not be more intuitive to have support for\n>> \t>\n>>         > git bisect skip A..B\n>> \t>\n>> \t> ?\n>>\n>> \tHere is a patch to do that. I am not sure it's worth it\n>> \tbecause this is a special case in many ways.\n> \n> Why not have something like\n> \n> \tskip)\n> \t\tfor arg in $(git rev-list \"$@\")\n> \t\tdo\n> \t\t\tbisect_state skip $arg\n> \t\tdone\n\nBecause if you say\n\n\t$ git bisect skip\n\nthis would be incorrectly calling rev-list; but more importantly, if you say\n\n\t$ git bisect skip A\n\nthen this would skip A *and all its ancestors*. Not quite what you intended.\n\n-- Hannes\n"},{"id":"96406","messageId":"alpine.DEB.1.00.0811241134540.30769@pacific.mpi-cbg.de","threadId":"16434","inReplyTo":"492A5346.1040405@viscovery.net","subject":"Re: [RFC/PATCH] bisect: teach \"skip\" to accept special arguments like \"A..B\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-11-24T10:35:11Z","receivedAt":"2008-11-24T10:35:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 24 Nov 2008, Johannes Sixt wrote:\n\n> Johannes Schindelin schrieb:\n> > On Sun, 23 Nov 2008, Christian Couder wrote:\n> >> \tDscho wrote:\n> >> \t> Would it not be more intuitive to have support for\n> >> \t>\n> >>         > git bisect skip A..B\n> >> \t>\n> >> \t> ?\n> >>\n> >> \tHere is a patch to do that. I am not sure it's worth it\n> >> \tbecause this is a special case in many ways.\n> > \n> > Why not have something like\n> > \n> > \tskip)\n> > \t\tfor arg in $(git rev-list \"$@\")\n> > \t\tdo\n> > \t\t\tbisect_state skip $arg\n> > \t\tdone\n> \n> Because if you say\n> \n> \t$ git bisect skip\n> \n> this would be incorrectly calling rev-list; but more importantly, if you say\n> \n> \t$ git bisect skip A\n> \n> then this would skip A *and all its ancestors*. Not quite what you intended.\n\nGood point indeed.\n\nThanks,\nDscho\n"},{"id":"96514","messageId":"7viqqbhwl9.fsf@gitster.siamese.dyndns.org","threadId":"16434","inReplyTo":"20081123220249.2e7f30a5.chriscool@tuxfamily.org","subject":"Re: [RFC/PATCH] bisect: teach \"skip\" to accept special arguments like \"A..B\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-11-26T05:42:26Z","receivedAt":"2008-11-26T05:42:26Z","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> The current \"git bisect skip\" syntax is \"git bisect skip [<rev>...]\"\n> so it's already possible to skip a range of revisions using\n> something like:\n>\n> $ git bisect skip $(git rev-list A..B)\n>\n> where A and B are the bounds of the range we want to skip.\n>\n> This patch teaches \"git bisect skip\" to accept:\n>\n> $ git bisect skip A..B\n>\n> as an abbreviation for the former command.\n\nAlthough I fully realize that the established semantics of A..B in git is\nbottom-exclusive, top-inclusive, and this suggestion breaks the UI\nuniformity by deviating from that convention, I have to wonder if it would\nbe more useful if you let the bottom commit (A in your example) also be\nskipped.\n\nI would suspect that it would be more useful than the \"replace\" one, but\nthat is a separate issue.\n"}]}