{"thread":{"id":"47184","subject":"[PATCH] bisect run: die if no command is given","startedAt":"2017-11-12T20:57:24Z","lastAt":"2017-11-13T03:59:34Z","messageCount":2,"participants":["Stephan Beyer","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"332364","messageId":"20171112205533.9593-1-s-beyer@gmx.net","threadId":"47184","inReplyTo":null,"subject":"[PATCH] bisect run: die if no command is given","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2017-11-12T20:55:33Z","receivedAt":"2017-11-12T20:57:24Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"It was possible to invoke \"git bisect run\" without any command.\nThis considers all commits as good commits since \"$@\"'s return\nvalue for empty $@ is 0.\n\nThis is most probably not what a user wants (otherwise she would\ninvoke \"git bisect run true\"), so not providing a command now\nresults in an error.\n\nSigned-off-by: Stephan Beyer <s-beyer@gmx.net>\n---\n git-bisect.sh | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 0138a8860..a69e43656 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -450,6 +450,8 @@ bisect_replay () {\n bisect_run () {\n \tbisect_next_check fail\n \n+\ttest -n \"$*\" || die \"$(gettext \"bisect run failed: no command provided.\")\"\n+\n \twhile true\n \tdo\n \t\tcommand=\"$@\"\n-- \n2.15.0.165.g0dc13a7db.dirty\n\n"},{"id":"332391","messageId":"xmqqefp2akww.fsf@gitster.mtv.corp.google.com","threadId":"47184","inReplyTo":"20171112205533.9593-1-s-beyer@gmx.net","subject":"Re: [PATCH] bisect run: die if no command is given","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-13T03:59:27Z","receivedAt":"2017-11-13T03:59:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephan Beyer <s-beyer@gmx.net> writes:\n\n> It was possible to invoke \"git bisect run\" without any command.\n> This considers all commits as good commits since \"$@\"'s return\n> value for empty $@ is 0.\n>\n> This is most probably not what a user wants (otherwise she would\n> invoke \"git bisect run true\"), so not providing a command now\n> results in an error.\n>\n> Signed-off-by: Stephan Beyer <s-beyer@gmx.net>\n> ---\n\nMakes sense to me.  Thanks, will queue.\n\n>  git-bisect.sh | 2 ++\n>  1 file changed, 2 insertions(+)\n>\n> diff --git a/git-bisect.sh b/git-bisect.sh\n> index 0138a8860..a69e43656 100755\n> --- a/git-bisect.sh\n> +++ b/git-bisect.sh\n> @@ -450,6 +450,8 @@ bisect_replay () {\n>  bisect_run () {\n>  \tbisect_next_check fail\n>  \n> +\ttest -n \"$*\" || die \"$(gettext \"bisect run failed: no command provided.\")\"\n> +\n>  \twhile true\n>  \tdo\n>  \t\tcommand=\"$@\"\n"}]}